Skip to content

fix(deps): update codacy/codacy-analysis-cli-action action to v4.4.4 #117

fix(deps): update codacy/codacy-analysis-cli-action action to v4.4.4

fix(deps): update codacy/codacy-analysis-cli-action action to v4.4.4 #117

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@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
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 }}"