fix(deps): update actions/setup-python action to v5.2.0 #135
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: Execute script and commit changes to git | |
on: | |
pull_request: | |
types: [opened, synchronize, edited] | |
branches: | |
- main | |
workflow_call: | |
inputs: | |
script_path: | |
description: Path to the script, relative to the repository root e.g. ./scripts/update-readme.sh | |
required: true | |
type: string | |
ref: | |
description: Branch to commit changes to | |
required: true | |
type: string | |
commit_message: | |
description: Commit message, defaults to "Update README.md" | |
required: false | |
type: string | |
default: ':memo: doc: Update README.md' | |
commit_author: | |
description: Commit author, defaults to GitHub Action | |
required: false | |
type: string | |
default: GitHub Action | |
commit_email: | |
description: Commit email, defaults to GitHub Action email | |
required: false | |
type: string | |
default: 41898282+github-actions[bot]@users.noreply.github.com | |
harden_runner: | |
description: "Harden the runner" | |
required: false | |
default: true | |
type: boolean | |
permissions: {} | |
concurrency: | |
group: modification-script-${{ github.repository }}-${{ github.ref }} | |
jobs: | |
execute-script: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
BRANCH: ${{ inputs.ref || github.head_ref }} | |
steps: | |
- name: Harden the runner | |
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 | |
if: ${{ inputs.harden_runner != false }} | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
github.com:443 | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ env.BRANCH }} | |
- name: Run script | |
run: | | |
chmod +x ${{ inputs.script_path || './scripts/generate_workflows_table.sh' }} | |
${{ inputs.script_path || './scripts/generate_workflows_table.sh'}} | |
- name: Detect changes | |
id: detect_changes | |
run: | | |
git diff --quiet || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: steps.detect_changes.outputs.changed == 'true' | |
run: | | |
git config --local user.name "${{ inputs.commit_author || 'GitHub Action' }}" | |
git config --local user.email "${{ inputs.commit_email || '41898282+github-actions[bot]@users.noreply.github.com'}}" | |
git add . | |
git commit -m "${{ inputs.commit_message || ':memo: doc: Update workflow list in README.md'}}" | |
git push origin "${{ env.BRANCH }}" |