Repository navigation
53 lines (50 loc) · 1.95 KB
/
Copy pathcheck-plugin.yml
File metadata and controls
53 lines (50 loc) · 1.95 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
name: Check Plugin
on:
workflow_call:
inputs:
repository:
description: Plugin repository to check; defaults to the caller
type: string
required: false
default: ''
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout plugin
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: ${{ inputs.repository || github.repository }}
path: plugin
persist-credentials: false
- name: Checkout release tool
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
repository: version-fox/plugin-manifest-action
# JSON round-trip lets actionlint v1.7.12 accept this new job property.
ref: ${{ fromJSON(toJSON(job)).workflow_sha }}
path: release-tool
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version-file: release-tool/go.mod
cache-dependency-path: release-tool/go.sum
- name: Check opt-in Lua formatting
if: ${{ hashFiles('plugin/stylua.toml') != '' }}
uses: JohnnyMorganz/stylua-action@479972f01e665acfcba96ada452c36608bdbbb5e # v4
with:
token: ${{ github.token }}
version: v2.5.2
args: --check --config-path plugin/stylua.toml plugin
- name: Validate metadata, Lua syntax and package
working-directory: release-tool
env:
PLUGIN_REPOSITORY: ${{ inputs.repository || github.repository }}
ARTIFACT_DIRECTORY: ${{ runner.temp }}/plugin-check
TOOL_WORKFLOW_SHA: ${{ fromJSON(toJSON(job)).workflow_sha }}
run: |
test "$(git rev-parse HEAD)" = "$TOOL_WORKFLOW_SHA"
go run ./cmd/plugin-release check --source ../plugin --repository "$PLUGIN_REPOSITORY" --out "$ARTIFACT_DIRECTORY"