-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 2.13 KB
/
finalize-template.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
name: Finalize Template
on:
workflow_dispatch:
inputs:
app_name:
required: false
description: >
This is the name of your app; if left blank, it will match the
name of your repository, e.g. "UWIT-IAM/<app-name>"
maintainer:
required: false
description: >
The github username for the default repository maintainer;
if left blank, will match the github user invoking this workflow.
jobs:
finalize-template:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: abatilo/[email protected]
- run: |
app_name="${{ github.event.inputs.app_name }}"
maintainer="${{ github.event.inputs.maintainer }}"
if [[ -z "${app_name}" ]]
then
app_name=$(echo "${{ github.repository }}" | cut -f2 -d'/')
echo "::notice::app name determined to be ${app_name}"
fi
if [[ -z "${maintainer}" ]]
then
maintainer="${{ github.actor }}"
echo "::notice::app maintainer determined to be ${maintainer}"
fi
python scripts/finalize-template.py \
--app-name ${app_name} --maintainer ${maintainer}
rm .github/workflows/finalize-template.yaml
- name: Create Pull Request
uses: peter-evans/[email protected]
with:
token: ${{ secrets.ACTIONS_PAT }}
branch: finalize-template
delete-branch: true
assignees: ${{ github.actor }}
reviewers: ${{ github.actor }}
labels: 'semver-guidance:no-bump'
title: Fill in template variables and finish configuring the repository
commit-message: >
Finalize template repository.
This request has been generated as the result of a GitHub action.
If everything looks OK to you, you can approve the pull request and merge
it in. Otherwise, you can either edit the pull request until it's to your
liking, or close it, and re-run the `finalize-template` workflow.