Skip to content

chore(deps): bump github/gh-aw-actions from 0.79.3 to 0.79.8 in the github-actions group #267

chore(deps): bump github/gh-aw-actions from 0.79.3 to 0.79.8 in the github-actions group

chore(deps): bump github/gh-aw-actions from 0.79.3 to 0.79.8 in the github-actions group #267

name: Bump template versions
on:
pull_request:
branches: [main]
types: [closed]
permissions: {}
jobs:
bump-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Bump template version
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.merge_commit_sha || github.sha }}
run: python3 .github/scripts/bump_template_versions.py
- name: Detect version bump changes
id: changes
run: |
if git diff --quiet -- csv-templates prompt-templates; then
echo "changed=false" >> "$GITHUB_OUTPUT"
echo "ℹ️ No version bump changes detected."
else
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "✅ Version bump changes detected."
fi
- name: Commit and push version bumps branch
if: steps.changes.outputs.changed == 'true'
uses: ./.github/actions/commit-and-push
with:
commit_message: "chore: bump template version(s)"
add: "csv-templates prompt-templates"
push_to: "chore/9000-bump-template-version"
force: "true"
- name: Open or reuse version bump pull request
if: steps.changes.outputs.changed == 'true'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const head = `${owner}:chore/9000-bump-template-version`;
const base = "main";
const existing = await github.rest.pulls.list({
owner,
repo,
state: "open",
head,
base,
per_page: 1,
});
if (existing.data.length > 0) {
core.info(`ℹ️ Reusing existing PR #${existing.data[0].number}`);
return;
}
const created = await github.rest.pulls.create({
owner,
repo,
title: "chore: bump template version(s)",
head: "chore/9000-bump-template-version",
base,
body: [
"Automated template version bump PR generated by the",
"`bump-template-version` workflow after a merged PR.",
].join("\n\n"),
});
core.info(`✅ Created PR #${created.data.number}`);