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

fix: some actions should have secrets.GH_TOKEN #732

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/add-scope-to-bet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
id: parse
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
result-encoding: json
script: |
const regexSimple = /(Related\sto\s+(\S+)?#(\d+))/;
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
uses: actions/github-script@v6
if: ${{ steps.parse.outputs.result }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
script: |
const results = ${{ steps.parse.outputs.result }};
if (!results) {
Expand Down
Empty file removed .github/workflows/check-adr.yml
Empty file.
14 changes: 8 additions & 6 deletions .github/workflows/lint-pr-adr.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: PR ADR Validation Workflow

on:
pull_request:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
- labeled
- unlabeled
- ready_for_review

jobs:
validate_adr_pr:
Expand All @@ -18,7 +20,7 @@ jobs:
id: lint_title_adr
with:
result-encoding: json
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GH_TOKEN }}
script: |
const title = context.payload.pull_request.title;
const labels = context.payload.pull_request.labels;
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
# condition you can continue the execution with the populated error message.
with:
header: pr-title-lint-adr-error
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
message: |
Hey there and thank you for opening this ADR pull request! 👋🏼
The ADR Pull request must follow this PR naming convention:
Expand All @@ -70,7 +72,7 @@ jobs:
- if: (fromJSON(steps.lint_title_adr.outputs.result).status == 'ok')
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
header: pr-title-lint-adr-error
delete: true
- if: (fromJSON(steps.lint_title_adr.outputs.result).status == 'ok')
Expand Down Expand Up @@ -102,7 +104,7 @@ jobs:
# condition you can continue the execution with the populated error message.
with:
header: pr-files-changed-adr-error
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
message: |
Hey there and thank you for opening this ADR pull request! 👋🏼
The ADR Pull request must change only the ADR file that match ${{ fromJSON(steps.lint_title_adr.outputs.result).expectedFileMatch }}
Expand All @@ -115,6 +117,6 @@ jobs:
name: Delete comment fail changed
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
header: pr-files-changed-adr-error
delete: true