-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.15 KB
/
archive.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 [email protected]
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