-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.52 KB
/
noticeme.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
name: "Run noticeme"
on:
schedule:
- cron: '34 1 * * 1'
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.DEPENDABOT_PAT }}
jobs:
noticeme:
name: Update JS notices
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: save Date
run: echo "date=$(date +%Y-%m-%d)" >> "$GITHUB_ENV"
shell: bash
- name: Checkout repository
uses: actions/checkout@v4
with:
# Using a Personal Access Token here is required to trigger workflows on our new commit.
# The default GitHub token doesn't trigger any workflows.
# See: https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/2
token: ${{ secrets.DEPENDABOT_PAT }}
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: install via yarn
run: yarn --immutable
- name: Update NOTICE-js
run: yarn notice_update
- name: configure git
run: |
git config user.name "[email protected]"
git config user.email "[email protected]"
- name: commit NOTICE-js if needed
run: |
if ! git diff --exit-code NOTICE-js; then
git add NOTICE-js
git commit -m 'Update NOTICE for ${{ env.date }}'
git checkout -b notice-update-$date
git push --set-upstream origin notice-update-${{ env.date }} -f
gh pr create --fill
fi