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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass secrets to approved workflow jobs #258

Merged
merged 10 commits into from
Dec 2, 2023
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,18 @@ jobs:
- run: npm ci && npm run build
- run: npm test

access_check:
runs-on: ubuntu-latest
steps:
- name: Gather user permissions
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.author_association != 'MEMBER' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull_request_target still uses the event.pull_request values from what I can tell: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

run: |
echo "Action was not triggered by a collaborator. Exiting now."
exit 1

integration_test_botToken:
runs-on: ubuntu-latest
needs: access_check
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
Expand Down Expand Up @@ -47,6 +57,7 @@ jobs:

integration_test_webhook:
runs-on: ubuntu-latest
needs: access_check
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
Expand Down Expand Up @@ -80,6 +91,7 @@ jobs:

integration_test_incoming_webhook:
runs-on: ubuntu-latest
needs: access_check
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
Expand All @@ -100,6 +112,7 @@ jobs:

integration_test_file_payload:
runs-on: ubuntu-latest
needs: access_check
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
Expand Down