forked from swcarpentry/git-novice
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·66 lines (58 loc) · 2.1 KB
/
update-workflows.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: "02 Maintain: Update Workflow Files"
on:
workflow_dispatch:
inputs:
name:
description: 'Who triggered this build (enter github username to tag yourself)?'
required: true
default: 'weekly run'
clean:
description: 'Workflow files/file extensions to clean (no wildcards, enter "" for none)'
required: false
default: '.yaml'
schedule:
# Run every Tuesday
- cron: '0 0 * * 2'
jobs:
check_token:
name: "Check SANDPAPER_WORKFLOW token"
runs-on: ubuntu-latest
outputs:
workflow: ${{ steps.validate.outputs.wf }}
repo: ${{ steps.validate.outputs.repo }}
steps:
- name: "validate token"
id: validate
uses: carpentries/actions/check-valid-credentials@main
with:
token: ${{ secrets.SANDPAPER_WORKFLOW }}
update_workflow:
name: "Update Workflow"
runs-on: ubuntu-latest
needs: check_token
if: ${{ needs.check_token.outputs.workflow == 'true' }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v3
- name: Update Workflows
id: update
uses: carpentries/actions/update-workflows@main
with:
clean: ${{ github.event.inputs.clean }}
- name: Create Pull Request
id: cpr
if: "${{ steps.update.outputs.new }}"
uses: carpentries/create-pull-request@main
with:
token: ${{ secrets.SANDPAPER_WORKFLOW }}
delete-branch: true
branch: "update/workflows"
commit-message: "[actions] update sandpaper workflow to version ${{ steps.update.outputs.new }}"
title: "Update Workflows to Version ${{ steps.update.outputs.new }}"
body: |
:robot: This is an automated build
Update Workflows from sandpaper version ${{ steps.update.outputs.old }} -> ${{ steps.update.outputs.new }}
- Auto-generated by [create-pull-request][1] on ${{ steps.update.outputs.date }}
[1]: https://github.com/carpentries/create-pull-request/tree/main
labels: "type: template and tools"
draft: false