Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid hardcode parameter #57

Merged
merged 4 commits into from
Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
checklist:
name: Checklist Checker
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -62,11 +63,10 @@ jobs:
- name: Cache Swift dependencies
uses: actions/cache@v4
with:
path: |
~/.build
key: ${{ runner.os }}-swift-${{ hashFiles('**/*.swift') }}
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-
${{ runner.os }}-spm-

- name: Set Swift Version
uses: swift-actions/setup-swift@v1
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
run: |
# --edit-last
gh pr comment $PR_NUMBER --body "$COMMENT_BODY" --edit-last || gh pr comment $PR_NUMBER --body "$COMMENT_BODY"
gh pr comment $PR_NUMBER --body "$COMMENT_BODY" || gh pr comment $PR_NUMBER --body "$COMMENT_BODY"

- name: Return Status Test Success
if: success()
Expand All @@ -129,7 +129,15 @@ jobs:
run: |
# --edit-last
gh pr comment $PR_NUMBER --body "$COMMENT_BODY" || gh pr comment $PR_NUMBER --body "$COMMENT_BODY"
- name: Allow and Merge When Succes

allowgithub:
name: PR Approve
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Approved PR
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -140,8 +148,10 @@ jobs:
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_OWNER: ${{ github.repository_owner }}
# Using CLI Merge Pull Request
run: |
if [[ "${{ github.event.pull_request.user.login }}" == "iletai" ]]; then
# Check if the PR is create by owner this repo
if [[ "${{ github.event.pull_request.user.login }}" == "${REPO_OWNER}" ]]; then
gh pr merge ${{ github.event.number }} --squash --auto
fi
Loading