File tree Expand file tree Collapse file tree 3 files changed +67
-4
lines changed Expand file tree Collapse file tree 3 files changed +67
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : Update Self-References
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ paths :
8
+ # Currently reusable workflows only use markdown-templates but this may be extended to actions and other files in the future
9
+ - " markdown-templates/**"
10
+ workflow_dispatch :
11
+
12
+ permissions :
13
+ contents : write
14
+ pull-requests : write
15
+
16
+ jobs :
17
+ update_versions :
18
+ name : Update Exercise Toolkit Version References
19
+ runs-on : ubuntu-latest
20
+
21
+ steps :
22
+ - name : Checkout repository
23
+ uses : actions/checkout@v4
24
+ with :
25
+ fetch-depth : 0
26
+
27
+ - name : Update EXERCISE_TOOLKIT_REF in workflow files
28
+ uses : jacobtomlinson/gha-find-replace@v3
29
+ with :
30
+ find : ' EXERCISE_TOOLKIT_REF: [^\s]+'
31
+ replace : " EXERCISE_TOOLKIT_REF: ${{ github.sha }}"
32
+ include : " .github/workflows/*.yml"
33
+ exclude : " .github/workflows/_*.yml"
34
+ regex : true
35
+
36
+ - name : Create Pull Request
37
+ uses : peter-evans/create-pull-request@v7
38
+ with :
39
+ commit-message : " chore: update exercise-toolkit self-references to latest commit"
40
+ title : " chore: update exercise-toolkit self-references to latest commit"
41
+ body : |
42
+ ## 🔄 Automated Version Update
43
+
44
+ This PR automatically updates the `EXERCISE_TOOLKIT_REF` environment variable in reusable workflows to reference the latest commit
45
+
46
+ ---
47
+ *This PR was automatically created by the `update-self-references` workflow.*
48
+ branch : update-self-refs
49
+ delete-branch : true
50
+ add-paths : |
51
+ .github/workflows/*.yml
52
+ draft : false
53
+ reviewers : |
54
+ FidelusAleksander
55
+ labels : |
56
+ skip-release-notes
57
+ maintenance
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ permissions:
17
17
contents : write
18
18
issues : write
19
19
20
+ env :
21
+ EXERCISE_TOOLKIT_REF : v0.5.0
22
+
20
23
jobs :
21
24
update_readme :
22
25
name : Update README with congratulations
34
37
with :
35
38
repository : skills/exercise-toolkit
36
39
path : exercise-toolkit
37
- ref : v0.5.0
40
+ ref : ${{ env.EXERCISE_TOOLKIT_REF }}
38
41
39
42
- name : Build congratulations message from template
40
43
id : build-new-readme
67
70
with :
68
71
repository : skills/exercise-toolkit
69
72
path : exercise-toolkit
70
- ref : v0.5.0
73
+ ref : ${{ env.EXERCISE_TOOLKIT_REF }}
71
74
72
75
- name : Build message - exercise finished
73
76
id : build-finish-message
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ permissions:
29
29
actions : write # Disable workflows
30
30
issues : write # Create issue
31
31
32
+ env :
33
+ EXERCISE_TOOLKIT_REF : v0.5.0
34
+
32
35
jobs :
33
36
disable_workflows :
34
37
name : Disable exercise workflows
64
67
with :
65
68
repository : skills/exercise-toolkit
66
69
path : exercise-toolkit
67
- ref : v0.5.0
70
+ ref : ${{ env.EXERCISE_TOOLKIT_REF }}
68
71
69
72
- name : Build welcome message from template
70
73
id : build-issue-description
@@ -107,7 +110,7 @@ jobs:
107
110
with :
108
111
repository : skills/exercise-toolkit
109
112
path : exercise-toolkit
110
- ref : v0.5.0
113
+ ref : ${{ env.EXERCISE_TOOLKIT_REF }}
111
114
112
115
- name : Build welcome message from template
113
116
id : build-new-readme
You can’t perform that action at this time.
0 commit comments