-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (32 loc) · 1.1 KB
/
my-node-action.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
name: My Node Action
on:
push:
branches: [ main ]
schedule:
- cron: "15 17 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
my-action:
runs-on: ubuntu-latest
steps:
# Check out code using git
- uses: actions/checkout@v3
# Install Node 16
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install @octokit/action
# Node.js script can be anywhere. A good convention is to put local GitHub Actions
# into the `.github/actions` folder
# the GITHUB_TOKEN will get picked up by the Octokit library
# https://github.com/octokit/action.js
- run: node .github/actions/my-script.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action on Push"
- run: git add .
- run: git commit -m "Auto updating data.json file by GH Action"
- run: git fetch origin main
- run: git push origin HEAD:main