Created
February 5, 2025 04:02
-
-
Save cnlohr/43a1843e47e8527c7c16097b1aa369b1 to your computer and use it in GitHub Desktop.
workflow with manual dispatch and secret in environment - needs to be run manually - only works after committed to default branch
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
# So you don't pull your hair out, workflow dispatches must be in the default branch. | |
name: Secret Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
Secret-Test: | |
environment: test_environment | |
permissions: | |
statuses: write | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
submodules: recursive | |
- name: Install more dependencies | |
run: | | |
sudo apt-get install -y \ | |
make \ | |
build-essential | |
- name: Build | |
env: | |
TEST_SECRET: ${{ secrets.TEST_SECRET }} | |
run: make secrettest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment