security: update GitHub workflows to use ISSUES_BOT_TOKEN instead of GITHUB_TOKEN (#4606)
Signed| @@ -32,7 +32,7 @@ jobs: | |||
| 32 | with: | 32 | with: |
| 33 | configuration-path: .github/issues-auto-labels.yml | 33 | configuration-path: .github/issues-auto-labels.yml |
| 34 | enable-versioned-regex: 0 | 34 | enable-versioned-regex: 0 |
| 35 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 35 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 36 | 36 | ||
| 37 | label-on-labels: | 37 | label-on-labels: |
| 38 | name: π·οΈ Label Issues by Labels | 38 | name: π·οΈ Label Issues by Labels |
| @@ -46,7 +46,7 @@ jobs: | |||
| 46 | uses: actions-cool/issues-helper@v3.6.0 | 46 | uses: actions-cool/issues-helper@v3.6.0 |
| 47 | with: | 47 | with: |
| 48 | actions: 'add-labels' | 48 | actions: 'add-labels' |
| 49 | token: ${{ secrets.GITHUB_TOKEN }} | 49 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 50 | labels: 'π Approved' | 50 | labels: 'π Approved' |
| 51 | 51 | ||
| 52 | - name: β Remove progress labels when issue is marked done or stale | 52 | - name: β Remove progress labels when issue is marked done or stale |
| @@ -56,7 +56,7 @@ jobs: | |||
| 56 | uses: actions-cool/issues-helper@v3.6.0 | 56 | uses: actions-cool/issues-helper@v3.6.0 |
| 57 | with: | 57 | with: |
| 58 | actions: 'remove-labels' | 58 | actions: 'remove-labels' |
| 59 | token: ${{ secrets.GITHUB_TOKEN }} | 59 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 60 | labels: 'π§βπ» In Progress,π€ Unsure,π€ Under Consideration' | 60 | labels: 'π§βπ» In Progress,π€ Unsure,π€ Under Consideration' |
| 61 | 61 | ||
| 62 | - name: β Remove temporary labels when confirmed labels are added | 62 | - name: β Remove temporary labels when confirmed labels are added |
| @@ -66,7 +66,7 @@ jobs: | |||
| 66 | uses: actions-cool/issues-helper@v3.6.0 | 66 | uses: actions-cool/issues-helper@v3.6.0 |
| 67 | with: | 67 | with: |
| 68 | actions: 'remove-labels' | 68 | actions: 'remove-labels' |
| 69 | token: ${{ secrets.GITHUB_TOKEN }} | 69 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 70 | labels: 'π€ Unsure,π€ Under Consideration' | 70 | labels: 'π€ Unsure,π€ Under Consideration' |
| 71 | 71 | ||
| 72 | - name: β Remove no bug labels when "πͺ² Confirmed" is added | 72 | - name: β Remove no bug labels when "πͺ² Confirmed" is added |
| @@ -76,7 +76,7 @@ jobs: | |||
| 76 | uses: actions-cool/issues-helper@v3.6.0 | 76 | uses: actions-cool/issues-helper@v3.6.0 |
| 77 | with: | 77 | with: |
| 78 | actions: 'remove-labels' | 78 | actions: 'remove-labels' |
| 79 | token: ${{ secrets.GITHUB_TOKEN }} | 79 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 80 | labels: 'βοΈ Not Reproducible,βοΈ Not A Bug' | 80 | labels: 'βοΈ Not Reproducible,βοΈ Not A Bug' |
| 81 | 81 | ||
| 82 | remove-stale-label: | 82 | remove-stale-label: |
| @@ -92,7 +92,7 @@ jobs: | |||
| 92 | uses: actions-cool/issues-helper@v3.6.0 | 92 | uses: actions-cool/issues-helper@v3.6.0 |
| 93 | with: | 93 | with: |
| 94 | actions: 'remove-labels' | 94 | actions: 'remove-labels' |
| 95 | token: ${{ secrets.GITHUB_TOKEN }} | 95 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 96 | issue-number: ${{ github.event.issue.number }} | 96 | issue-number: ${{ github.event.issue.number }} |
| 97 | labels: 'β°οΈ Stale,πΈοΈ Inactive,π Awaiting User Response,π No Response' | 97 | labels: 'β°οΈ Stale,πΈοΈ Inactive,π Awaiting User Response,π No Response' |
| 98 | 98 | ||
| @@ -113,4 +113,4 @@ jobs: | |||
| 113 | uses: peaceiris/actions-label-commenter@v1.10.0 | 113 | uses: peaceiris/actions-label-commenter@v1.10.0 |
| 114 | with: | 114 | with: |
| 115 | config_file: .github/issues-auto-comments.yml | 115 | config_file: .github/issues-auto-comments.yml |
| 116 | github_token: ${{ secrets.GITHUB_TOKEN }} | 116 | github_token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| @@ -31,7 +31,7 @@ jobs: | |||
| 31 | - name: Label Linked Issues | 31 | - name: Label Linked Issues |
| 32 | id: label_linked_issues | 32 | id: label_linked_issues |
| 33 | env: | 33 | env: |
| 34 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 34 | GH_TOKEN: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 35 | run: | | 35 | run: | |
| 36 | for ISSUE in $(echo $issues | jq -r '.[]'); do | 36 | for ISSUE in $(echo $issues | jq -r '.[]'); do |
| 37 | if [ "${{ github.ref }}" == "refs/heads/staging" ]; then | 37 | if [ "${{ github.ref }}" == "refs/heads/staging" ]; then |
| @@ -22,7 +22,7 @@ jobs: | |||
| 22 | # https://github.com/marketplace/actions/close-stale-issues | 22 | # https://github.com/marketplace/actions/close-stale-issues |
| 23 | uses: actions/stale@v9.1.0 | 23 | uses: actions/stale@v9.1.0 |
| 24 | with: | 24 | with: |
| 25 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 25 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 26 | days-before-stale: 183 | 26 | days-before-stale: 183 |
| 27 | days-before-close: 7 | 27 | days-before-close: 7 |
| 28 | operations-per-run: 30 | 28 | operations-per-run: 30 |
| @@ -56,7 +56,7 @@ jobs: | |||
| 56 | # https://github.com/marketplace/actions/close-stale-issues | 56 | # https://github.com/marketplace/actions/close-stale-issues |
| 57 | uses: actions/stale@v9.1.0 | 57 | uses: actions/stale@v9.1.0 |
| 58 | with: | 58 | with: |
| 59 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 59 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 60 | days-before-stale: 7 | 60 | days-before-stale: 7 |
| 61 | days-before-close: 7 | 61 | days-before-close: 7 |
| 62 | operations-per-run: 30 | 62 | operations-per-run: 30 |
| @@ -83,7 +83,7 @@ jobs: | |||
| 83 | # https://github.com/marketplace/actions/close-stale-issues | 83 | # https://github.com/marketplace/actions/close-stale-issues |
| 84 | uses: actions/stale@v9.1.0 | 84 | uses: actions/stale@v9.1.0 |
| 85 | with: | 85 | with: |
| 86 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 86 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 87 | days-before-stale: 7 | 87 | days-before-stale: 7 |
| 88 | days-before-close: 7 | 88 | days-before-close: 7 |
| 89 | operations-per-run: 30 | 89 | operations-per-run: 30 |
| @@ -23,6 +23,6 @@ jobs: | |||
| 23 | uses: actions-cool/issues-helper@v3.6.0 | 23 | uses: actions-cool/issues-helper@v3.6.0 |
| 24 | with: | 24 | with: |
| 25 | actions: remove-labels | 25 | actions: remove-labels |
| 26 | token: ${{ secrets.GITHUB_TOKEN }} | 26 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 27 | issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} | 27 | issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} |
| 28 | labels: 'π Awaiting User Response,π§βπ» In Progress,π Keep Open,π« Merge Conflicts,π¬ Needs Testing,π¨ Needs Work,β°οΈ Stale,β Waiting For External/Upstream' | 28 | labels: 'π Awaiting User Response,π§βπ» In Progress,π Keep Open,π« Merge Conflicts,π¬ Needs Testing,π¨ Needs Work,β°οΈ Stale,β Waiting For External/Upstream' |
| @@ -24,6 +24,6 @@ jobs: | |||
| 24 | uses: actions-cool/issues-helper@v3.6.0 | 24 | uses: actions-cool/issues-helper@v3.6.0 |
| 25 | with: | 25 | with: |
| 26 | actions: 'add-labels' | 26 | actions: 'add-labels' |
| 27 | token: ${{ secrets.GITHUB_TOKEN }} | 27 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 28 | issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} | 28 | issue-number: ${{ github.event.issue.number || github.event.pull_request.number }} |
| 29 | labels: 'π· Maintainer' | 29 | labels: 'π· Maintainer' |
| @@ -76,7 +76,7 @@ jobs: | |||
| 76 | # https://github.com/marketplace/actions/pull-request-size-labeler | 76 | # https://github.com/marketplace/actions/pull-request-size-labeler |
| 77 | uses: codelytv/pr-size-labeler@v1.10.2 | 77 | uses: codelytv/pr-size-labeler@v1.10.2 |
| 78 | with: | 78 | with: |
| 79 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 79 | GITHUB_TOKEN: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 80 | xs_label: 'π© ⬀ββββ' | 80 | xs_label: 'π© ⬀ββββ' |
| 81 | xs_max_size: '20' | 81 | xs_max_size: '20' |
| 82 | s_label: 'π© ⬀⬀βββ' | 82 | s_label: 'π© ⬀⬀βββ' |
| @@ -109,7 +109,7 @@ jobs: | |||
| 109 | uses: actions/labeler@v5.0.0 | 109 | uses: actions/labeler@v5.0.0 |
| 110 | with: | 110 | with: |
| 111 | configuration-path: .github/pr-auto-labels-by-branch.yml | 111 | configuration-path: .github/pr-auto-labels-by-branch.yml |
| 112 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 112 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 113 | 113 | ||
| 114 | label-by-files: | 114 | label-by-files: |
| 115 | name: π·οΈ Label PR by Files | 115 | name: π·οΈ Label PR by Files |
| @@ -129,7 +129,7 @@ jobs: | |||
| 129 | uses: actions/labeler@v5.0.0 | 129 | uses: actions/labeler@v5.0.0 |
| 130 | with: | 130 | with: |
| 131 | configuration-path: .github/pr-auto-labels-by-files.yml | 131 | configuration-path: .github/pr-auto-labels-by-files.yml |
| 132 | repo-token: ${{ secrets.GITHUB_TOKEN }} | 132 | repo-token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 133 | 133 | ||
| 134 | remove-stale-label: | 134 | remove-stale-label: |
| 135 | name: ποΈ Remove Stale Label on Comment | 135 | name: ποΈ Remove Stale Label on Comment |
| @@ -150,7 +150,7 @@ jobs: | |||
| 150 | uses: actions-cool/issues-helper@v3.6.0 | 150 | uses: actions-cool/issues-helper@v3.6.0 |
| 151 | with: | 151 | with: |
| 152 | actions: 'remove-labels' | 152 | actions: 'remove-labels' |
| 153 | token: ${{ secrets.GITHUB_TOKEN }} | 153 | token: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 154 | issue-number: ${{ github.event.pull_request.number }} | 154 | issue-number: ${{ github.event.pull_request.number }} |
| 155 | labels: 'β°οΈ Stale' | 155 | labels: 'β°οΈ Stale' |
| 156 | 156 | ||
| @@ -250,7 +250,7 @@ jobs: | |||
| 250 | PR_NUMBER=${{ github.event.pull_request.number }} | 250 | PR_NUMBER=${{ github.event.pull_request.number }} |
| 251 | REPO=${{ github.repository }} | 251 | REPO=${{ github.repository }} |
| 252 | API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues" | 252 | API_URL="https://api.github.com/repos/$REPO/pulls/$PR_NUMBER/issues" |
| 253 | ISSUES=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]') | 253 | ISSUES=$(curl -s -H "Authorization: token ${{ secrets.ISSUES_BOT_TOKEN }}" "$API_URL" | jq -r '.[].number' | jq -R -s -c 'split("\n")[:-1]') |
| 254 | echo "linked_issues=$ISSUES" >> $GITHUB_ENV | 254 | echo "linked_issues=$ISSUES" >> $GITHUB_ENV |
| 255 | 255 | ||
| 256 | - name: Merge Issue Lists | 256 | - name: Merge Issue Lists |
| @@ -262,7 +262,7 @@ jobs: | |||
| 262 | - name: Label Linked Issues | 262 | - name: Label Linked Issues |
| 263 | id: label_linked_issues | 263 | id: label_linked_issues |
| 264 | env: | 264 | env: |
| 265 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 265 | GH_TOKEN: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 266 | run: | | 266 | run: | |
| 267 | for ISSUE in $(echo $final_issues | jq -r '.[]'); do | 267 | for ISSUE in $(echo $final_issues | jq -r '.[]'); do |
| 268 | gh issue edit $ISSUE -R ${{ github.repository }} --add-label "β Done (staging)" --remove-label "π§βπ» In Progress" | 268 | gh issue edit $ISSUE -R ${{ github.repository }} --add-label "β Done (staging)" --remove-label "π§βπ» In Progress" |
| @@ -23,6 +23,6 @@ jobs: | |||
| 23 | uses: eps1lon/actions-label-merge-conflict@v3.0.3 | 23 | uses: eps1lon/actions-label-merge-conflict@v3.0.3 |
| 24 | with: | 24 | with: |
| 25 | dirtyLabel: 'π« Merge Conflicts' | 25 | dirtyLabel: 'π« Merge Conflicts' |
| 26 | repoToken: ${{ secrets.GITHUB_TOKEN }} | 26 | repoToken: ${{ secrets.ISSUES_BOT_TOKEN }} |
| 27 | commentOnDirty: > | 27 | commentOnDirty: > |
| 28 | β οΈ This PR has conflicts that need to be resolved before it can be merged. | 28 | β οΈ This PR has conflicts that need to be resolved before it can be merged. |