generated from ahmedali8/hardhat-ts-template
-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (46 loc) · 1.71 KB
/
use-template.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
name: "Create"
env:
DOTENV_CONFIG_PATH: "./.env.example"
# The workflow will run when `use this template` is used
on:
push:
jobs:
create:
# We only run this action when the repository isn't the template repository. References:
# - https://docs.github.com/en/actions/learn-github-actions/contexts
# - https://docs.github.com/en/actions/learn-github-actions/expressions
if: ${{ !github.event.repository.is_template }}
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: "Check out the repo"
uses: "actions/checkout@v4"
- name: "Update repository metadata"
env:
GITHUB_REPOSITORY_DESCRIPTION: ${{ github.event.repository.description }}
run:
./.github/scripts/ci.sh "$GITHUB_REPOSITORY" "$GITHUB_REPOSITORY_OWNER"
"$GITHUB_REPOSITORY_DESCRIPTION"
- name: "Add update summary"
run: |
echo "## Update Metadata results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: "Remove `ci.sh` and `create.yml`"
run: |
rm -f "./.github/scripts/ci.sh"
rm -f "./.github/workflows/create.yml"
- name: "Add remove summary"
run: |
echo "## Remove result" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: "Update commit"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "feat: initial commit"
commit_options: "--amend"
push_options: "--force"
skip_fetch: true
- name: "Add commit summary"
run: |
echo "## Commit results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY