-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.19 KB
/
updateCodeJSON.yml
File metadata and controls
41 lines (37 loc) · 1.19 KB
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
name: Update Code.json
on:
schedule:
- cron: 0 0 1 * * # First day of every month
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- "code.json"
permissions:
contents: write
pull-requests: write
issues: write
jobs:
update-code-json:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update code.json
id: update
uses: DSACMS/automated-codejson-generator@dev
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ADMIN_TOKEN: ${{ secrets.CONTRIBUTOR_TOKEN }} # PAT with admin/push permissions
BRANCH: "main"
SKIP_PR: "true"
- name: Report update method
run: |
echo "Update successful: ${{ steps.update.outputs.updated }}"
if [ "${{ steps.update.outputs.method_used }}" = "direct_push" ]; then
echo "Direct push successful! Commit SHA: ${{ steps.update.outputs.commit_sha }}"
elif [ "${{ steps.update.outputs.method_used }}" = "pull_request" ]; then
echo "Created pull request: ${{ steps.update.outputs.pr_url }}"
fi