-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (28 loc) · 930 Bytes
/
git_updates.yml
File metadata and controls
39 lines (28 loc) · 930 Bytes
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
# This workflow will update something in the repo, stage it, commit it, and push it
name: Update the repo with changes from the action
on: workflow_dispatch
env:
BRANCH_NAME: update-timestamp
OUTPUT_NAME: now.txt
jobs:
update-repo:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Setup git
run: |
git config user.name "GitHub Actions Automation"
git config user.email "<>"
git checkout ${BRANCH_NAME} 2>/dev/null || git checkout -b ${BRANCH_NAME}
- name: Update the random number
run: python update_timestamp.py --file ${OUTPUT_NAME}
- name: Update the repo
run: |
git add ${OUTPUT_NAME}
git commit -m "Updated the file from a Github Action"
git push origin ${BRANCH_NAME}