Skip to content

Commit f8b21f7

Browse files
authored
Use secrets.GITHUB_TOKEN instead of secrets.PAT (#65)
Signed-off-by: John Mertic <[email protected]>
1 parent 04fe7a0 commit f8b21f7

File tree

3 files changed

+64
-10
lines changed

3 files changed

+64
-10
lines changed

.github/workflows/automerge.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Automerge PRs from LFX Landscape Tools
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "45 4 * * *"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Automerge PR if label is set to `automated-build`
13+
uses: pascalgn/automerge-action@7961b8b5eec56cc088c140b56d864285eabd3f67 # v0.16.4
14+
env:
15+
MERGE_LABELS: "automated-build"
16+
MERGE_RETRY_SLEEP: 300000
17+
MERGE_METHOD: "squash"
18+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/preview.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Preview
2+
3+
permissions:
4+
pull-requests: write
5+
6+
on:
7+
pull_request_target:
8+
branches:
9+
- main
10+
- master
11+
paths:
12+
- 'landscape.yml'
13+
- 'hosted_logos/*'
14+
types:
15+
- opened
16+
17+
jobs:
18+
comment:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
22+
env:
23+
LANDSCAPE_URL: 'https://landscape.aousd.org'
24+
DATA_FILE: 'landscape.yml'
25+
LOGOS_PATH: 'hosted_logos'
26+
OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
27+
REPO: ${{ github.event.pull_request.head.repo.name }}
28+
REF: ${{ github.event.pull_request.head.ref }}
29+
with:
30+
script: |
31+
const { LANDSCAPE_URL, DATA_FILE, LOGOS_PATH, OWNER, REPO, REF } = process.env
32+
const comment = `You can preview your changes by [visiting this link](${LANDSCAPE_URL}/?overlay-data=https://raw.githubusercontent.com/${OWNER}/${REPO}/${REF}/${DATA_FILE}&overlay-logos=https://raw.githubusercontent.com/${OWNER}/${REPO}/${REF}/${LOGOS_PATH}).\n\n> [!NOTE]\n > This feature is still experimental and may not work as expected in some cases. Please report any issues you find!`
33+
34+
github.rest.issues.createComment({
35+
issue_number: context.issue.number,
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
body: comment
39+
})

.github/workflows/validate.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
name: Validate
1+
name: Validate Landscape
22

33
on:
44
merge_group:
5+
pull_request_target:
6+
branches:
7+
- main
8+
- master
59
pull_request:
610
branches:
711
- main
@@ -12,15 +16,8 @@ jobs:
1216
runs-on: ubuntu-latest
1317
name: "Validate landscape.yml file"
1418
steps:
15-
- uses: actions/checkout@v4
16-
- uses: cncf/landscape2-validate-action@v2
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
- uses: cncf/landscape2-validate-action@6381e8747c73412e638670807b402ef2b863e9f8 # v2.0.1
1721
with:
1822
target_kind: data
1923
target_path: ./landscape.yml
20-
- uses: pascalgn/[email protected]
21-
if: success()
22-
env:
23-
GITHUB_TOKEN: "${{ secrets.PAT }}"
24-
MERGE_LABELS: "automated-build"
25-
MERGE_RETRY_SLEEP: 300000
26-
MERGE_METHOD: "squash"

0 commit comments

Comments
 (0)