@Desktop • Generate Screenshots triggered by angusbayley on branch support/signed-screenshot-gh-commits-swinton-test-2 #1090
This file contains 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
name: "@Desktop • Generate Screenshots" | |
run-name: "@Desktop • Generate Screenshots triggered by ${{ inputs.login }} ${{ inputs.ref && format('on branch {0}', inputs.ref) || format('on PR {0}', inputs.number) }}" | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: The branch to generate screenshots for. | |
required: false | |
number: | |
description: The pull request number. | |
required: false | |
login: | |
description: The GitHub username that triggered the workflow | |
required: false | |
commentId: | |
description: comment id to update | |
required: false | |
concurrency: | |
# See: https://github.com/orgs/community/discussions/35341 | |
group: ${{ github.workflow }}-${{ github.event.inputs.ref || github.event.inputs.number }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
generate-screenshots-linux: | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
env: | |
NODE_OPTIONS: "--max-old-space-size=7168" | |
FORCE_COLOR: 3 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
runs-on: [ledger-live-4xlarge] | |
steps: | |
- name: generate token | |
id: generate-token | |
uses: tibdex/github-app-token@v1 | |
with: | |
app_id: ${{ secrets.GH_BOT_APP_ID }} | |
private_key: ${{ secrets.GH_BOT_PRIVATE_KEY }} | |
- uses: actions/checkout@v4 | |
if: ${{ inputs.ref != null }} | |
with: | |
ref: ${{ inputs.ref }} | |
fetch-depth: 0 | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Create dummy file | |
run: echo "This is a dummy file" > dummyfile.txt | |
- name: Display dummy file contents | |
run: cat dummyfile.txt | |
- name: Commit file | |
uses: swinton/[email protected] | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: | | |
dummyfile.txt | |
commit-message: Committing dummyfile.txt | |
ref: refs/heads/support/signed-screenshot-gh-commits-swinton-test-2 | |
- name: Create 2nd dummy file | |
run: echo "This is a SECOND dummy file" > dummyfile2.txt | |
- name: Display dummy file 2 contents | |
run: cat dummyfile2.txt | |
- name: Commit updated screenshots to PR | |
id: commit-screenshots | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
env: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file_pattern: "dummyfile.txt" | |
commit_message: "commit dummyfile 2" | |