mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 06:31:06 +01:00
ci: update action, fix path
This commit is contained in:
parent
89a7c5922f
commit
62e52832e7
2 changed files with 28 additions and 26 deletions
50
.github/workflows/validate.yml
vendored
50
.github/workflows/validate.yml
vendored
|
@ -1,35 +1,35 @@
|
||||||
name: Validate
|
name: Validate
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: refs/pull/${{ github.event.number }}/merge
|
ref: refs/pull/${{ github.event.number }}/merge
|
||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: oven-sh/setup-bun@v1
|
uses: oven-sh/setup-bun@v1
|
||||||
with:
|
with:
|
||||||
bun-version: latest
|
bun-version: latest
|
||||||
|
|
||||||
- name: Get changed files
|
- name: Get changed files
|
||||||
uses: Mineflash07/gh-action-get-changed-files@feature/support-pr-target-event
|
uses: lots0logs/gh-action-get-changed-files@e5c59575dff4a94f74c6cc609a77c71f0becf7ec
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Update files.json file
|
- name: Update files.json file
|
||||||
run: cp $HOME/files.json ./scripts/validate_tags/
|
run: cp $HOME/files.json ./scripts/validate_tags/
|
||||||
|
|
||||||
- name: Validate tags
|
- name: Validate tags
|
||||||
run: |
|
run: |
|
||||||
bun i
|
bun i
|
||||||
bun run validate:tags
|
bun run validate:tags
|
||||||
env:
|
env:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
commit-sha: ${{ github.event.pull_request.head.sha }}
|
commit-sha: ${{ github.event.pull_request.head.sha }}
|
||||||
pr-number: ${{ github.event.pull_request.number }}
|
pr-number: ${{ github.event.pull_request.number }}
|
||||||
|
|
|
@ -12,7 +12,9 @@ const urlRegex =
|
||||||
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/gi;
|
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)/gi;
|
||||||
|
|
||||||
// Check if files/tags.toml was changed
|
// Check if files/tags.toml was changed
|
||||||
const files = (await Bun.file("./files.json").json()) as string[];
|
const files = (await Bun.file(
|
||||||
|
join(import.meta.dir, "files.json")
|
||||||
|
).json()) as string[];
|
||||||
if (!files.some((f) => f.includes("tags"))) process.exit(0);
|
if (!files.some((f) => f.includes("tags"))) process.exit(0);
|
||||||
|
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
|
|
Loading…
Reference in a new issue