-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (34 loc) · 1.21 KB
/
update-spdx-header.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
# This is a scheduled workflow to keep the spdx header up to date
name: Update spdx header
on:
schedule:
# Runs at 00:00 UTC on the 2nd January of every year
- cron: '0 0 2 1 *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
update:
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
name: Update spdx header
runs-on: ubuntu-20.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@v4 # v3.5.3
- name: Update spdx header
run: |
sed -i "s/[0-9]\{4\}/$(date +%Y)/" spdx_header.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
commit-message: 'chore: update spdx header'
title: 'chore: update spdx header'
branch: chore-spdx-header
delete-branch: true
author: GitHub <noreply@github.com>