-
-
Notifications
You must be signed in to change notification settings - Fork 0
[ci] Fix GitHub Actions workflow caching and auto-assign/label-sync configuration (#36) #35
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
90acbcc
refactor(workflows): simplify Composer caching in reports, tests, and…
coisa a6803ae
feat(workflows): optimize Composer install arguments for reports, tes…
coisa e43c41e
refactor(workflows): standardize Composer install arguments across re…
coisa d34f75f
refactor(workflows): separate command and args for Composer installat…
coisa 1a6ec26
feat(workflows): add auto-assign workflow for PR authors
coisa 985aadd
feat(workflows): add workflow_dispatch trigger to auto-assign workflow
coisa 7952368
feat(workflows): add 'synchronize' event to pull_request_target trigg…
coisa c7638bb
feat(workflows): add Composer audit step to PHPUnit tests workflow
coisa 4f50414
Add label-sync workflow that copies issue labels to PRs
coisa d68a088
Fix label-sync reusable workflow to match other resources patterns
coisa 02052b3
feat(workflows): update condition for label sync job to include non-w…
coisa e00250d
Potential fix for pull request finding 'CodeQL / Code injection'
coisa a96f99b
Potential fix for pull request finding 'CodeQL / Code injection'
coisa 4235118
fix(workflows): corrigir nome do workflow para 'Pull Request Label Sync'
coisa cc91437
fix(workflows): simplify the extraction of the issue number in the la…
coisa 305a8fd
fix(workflows): improve the extraction of the issue number in the lab…
coisa 6c039dd
Fix label-sync to specify repo and add checkout step
coisa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: Auto assign PR author | ||
|
|
||
| on: | ||
| issues: | ||
| types: [ opened, reopened ] | ||
| pull_request_target: | ||
| types: [ opened, reopened, synchronize ] | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| assign-author: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Auto assign PR author | ||
| uses: toshimaru/auto-author-assign@v3.0.1 | ||
| with: | ||
| repo-token: ${{ github.token }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: PR Label Sync | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize] | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| workflow_call: | ||
| inputs: | ||
| copy_issue_labels: | ||
| type: boolean | ||
| default: true | ||
| description: "Copy labels from linked issue" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| copy-issue-labels: | ||
| if: inputs.copy_issue_labels == true | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Extract issue number from PR | ||
| id: extract-issue | ||
| run: | | ||
| BODY='${{ github.event.pull_request.body }}' | ||
Check failureCode scanning / CodeQL Code injection Critical
Potential code injection in
${ github.event.pull_request.body } Error loading related location Loading pull_request_target Error loading related location Loading |
||
| TITLE='${{ github.event.pull_request.title }}' | ||
Check failureCode scanning / CodeQL Code injection Critical
Potential code injection in
${ github.event.pull_request.title } Error loading related location Loading pull_request_target Error loading related location Loading |
||
|
coisa marked this conversation as resolved.
Fixed
|
||
|
|
||
| ISSUE=$(echo "$BODY $TITLE" | \ | ||
| grep -oE '(closes|fixes|resolves|addresses)\s+#[[:digit:]]+' | \ | ||
| grep -oE '#[[:digit:]]+' | head -1 | tr -d '#') | ||
|
|
||
| if [ -n "$ISSUE" ]; then | ||
| echo "issue_number=$ISSUE" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Copy labels from issue to PR | ||
| if: steps.extract-issue.outputs.issue_number != '' | ||
| run: | | ||
| ISSUE_NUM=${{ steps.extract-issue.outputs.issue_number }} | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| PR_NUM=${{ github.event.pull_request.number }} | ||
|
|
||
| LABELS=$(gh issue view "$ISSUE_NUM" --json labels --jq '.labels[].name') | ||
|
|
||
| for label in $LABELS; do | ||
| gh pr edit "$PR_NUM" --add-label "$label" 2>/dev/null || true | ||
| done | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| name: Auto assign | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize] | ||
| issues: | ||
| types: [opened, reopened] | ||
|
|
||
| jobs: | ||
| auto-assign: | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| uses: php-fast-forward/dev-tools/.github/workflows/auto-assign.yml@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Label sync | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize] | ||
| issues: | ||
| types: [opened, reopened] | ||
|
|
||
| jobs: | ||
| label-sync: | ||
| permissions: | ||
| pull-requests: write | ||
| uses: php-fast-forward/dev-tools/.github/workflows/label-sync.yml@main |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.