-
Notifications
You must be signed in to change notification settings - Fork 153
58 lines (49 loc) · 2.07 KB
/
Copy pathensure-skill-version-check.yml
File metadata and controls
58 lines (49 loc) · 2.07 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: validate-skill-version-check
on:
pull_request:
branches:
- main
paths:
- "plugins/power-pages/skills/**"
permissions:
contents: write
jobs:
validate-skill-version-check:
name: validate-skill-version-check
runs-on: ubuntu-latest
steps:
- name: generate app token
if: ${{ github.event.pull_request.head.repo.fork == false }}
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: 3189942
private-key: ${{ secrets.POWER_PLATFORM_SKILLS_APP_PRIVATE_KEY }}
- name: checkout (non-fork)
if: ${{ github.event.pull_request.head.repo.fork == false }}
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token }}
- name: checkout (fork)
if: ${{ github.event.pull_request.head.repo.fork == true }}
uses: actions/checkout@v4
- name: setup-node
uses: actions/setup-node@v4
with:
node-version: 20
- name: check-only (fork)
if: ${{ github.event.pull_request.head.repo.fork == true }}
run: node scripts/ensure-skill-version-check.js --check
- name: add missing version checks (non-fork)
if: ${{ github.event.pull_request.head.repo.fork == false }}
run: node scripts/ensure-skill-version-check.js
- name: commit and push if changed (non-fork)
if: ${{ github.event.pull_request.head.repo.fork == false }}
run: |
git diff --quiet && exit 0
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "plugins/power-pages/skills/*/SKILL.md"
git commit -m "Auto-add plugin version check to SKILL.md files"
git push