Skip to content

Archive a section #1

Archive a section

Archive a section #1

Workflow file for this run

name: Archive a section
on:
workflow_dispatch:
inputs:
sectionid:
type: string
description: ID of section to archive
required: true
jobs:
archive:
name: Archive specified section
runs-on: ubuntu-latest
steps:
# Using PAT instead of default GITHUB_TOKEN so that the push triggers the workflow that updates the server
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
preserve-credentials: true
- name: Push new file
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 50
shell: bash
command: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git pull origin main || git reset --hard origin/main
git config user.name github-actions
git config user.email github-actions@github.com
bash .github/scripts/archive_section.sh ${{inputs.sectionid}} generated/workshop-toolconf-values.yaml
git add ./generated
git commit -m "Archived section '${{inputs.sectionid}}'"
git push