-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 3.23 KB
/
check-repository-setup.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "Check repository setup"
on:
workflow_dispatch:
workflow_call:
secrets:
RML_MANIFEST_TOKEN:
required: true
STEAM_USER:
required: true
STEAM_TOKEN:
required: true
env:
RML_MANIFEST_REPO: "${{ github.repository_owner }}/resonite-mod-manifest"
permissions:
issues: write
jobs:
create-todo-issues:
runs-on: ubuntu-latest
steps:
- name: "Check STEAM_USER exists"
continue-on-error: true
id: steam-user
shell: bash
run: |
if [ "${{ secrets.STEAM_USER }}" == '' ]; then
exit 1;
fi
- name: "Check STEAM_TOKEN exists"
continue-on-error: true
id: steam-token
shell: bash
run: |
if [ "${{ secrets.STEAM_TOKEN }}" == '' ]; then
exit 1;
fi
- name: "Check RML_MANIFEST_TOKEN exists"
continue-on-error: true
id: manifest-token
shell: bash
run: |
if [ "${{ secrets.RML_MANIFEST_TOKEN }}" == '' ]; then
exit 1;
fi
- name: "Check if repository ${{ env.RML_MANIFEST_REPO }} exists"
id: manifest-repo
if: "${{ steps.manifest-token.outcome == 'success' }}"
continue-on-error: true
uses: actions/checkout@v4
with:
repository: ${{ env.RML_MANIFEST_REPO }}
token: ${{ secrets.RML_MANIFEST_TOKEN }}
path: manifest
- name: "Check that no directory .github_new exists (unfinished template initialization)"
id: github-new
continue-on-error: true
run: |
if [ cd .github_new ]; then
exit 1;
fi
- name: Create Issue with TODOs
if: "${{ steps.manifest-token.outcome != 'success' || steps.manifest-repo.outcome != 'success' || steps.steam-user.outcome != 'success' || steps.steam-token.outcome != 'success' || steps.github-new.outcome != 'success' }}"
uses: dacbd/create-issue-action@ba4d1c45cccf9c483f2720cefb40e437f0ee6f7d
with:
token: ${{ github.token }}
title: Setup repository to support full CI/CD
body: |
### Necessary actions:
- [${{ steps.manifest-token.outcome == 'success' && 'X' || ' ' }}] [Add secret](https://github.com/${{ github.repository }}/settings/secrets/actions) RML_MANIFEST_TOKEN
- [${{ steps.manifest-repo.outcome == 'success' && 'X' || ' ' }}] Make sure a RML manifest repository is set up that is a fork of the [Resonite Mod Manifest](https://github.com/resonite-modding-group/resonite-mod-manifest)
- [${{ steps.steam-user.outcome == 'success' && 'X' || ' ' }}] [Add secret](https://github.com/${{ github.repository }}/settings/secrets/actions) STEAM_USER
Note: Don't use your regular Steam account as enabled Steam Guard will interfere with automation!
- [${{ steps.steam-token.outcome == 'success' && 'X' || ' ' }}] [Add secret](https://github.com/${{ github.repository }}/settings/secrets/actions) STEAM_TOKEN
- [${{ steps.github-new.outcome == 'success' && 'X' || ' ' }}] Update workflows to finish template initialization (overwrite `.github` with `.github_new`)
This step is necessary since for security reasons workflows are not directly allowed to modify workflows.
assignees: ${{ github.repository_owner }}