-
Notifications
You must be signed in to change notification settings - Fork 451
Expand file tree
/
Copy pathvalidate-resolved-languages.yml
More file actions
80 lines (80 loc) · 2.38 KB
/
validate-resolved-languages.yml
File metadata and controls
80 lines (80 loc) · 2.38 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Validate Resolved Languages File
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
jobs:
validate-resolved-languages:
name: Validate Resolved Languages File
permissions:
contents: read
security-events: read
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: linked
use-all-platform-bundle: 'false'
setup-kotlin: 'false'
- name: Initialize CodeQL
id: init
uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Verify that the resolved languages file is up to date
env:
CODEQL: ${{ steps.init.outputs.codeql-path }}
RESOLVED_LANGUAGES_FILE: ../action/src/resolved-languages.json
run: |
if [ ! -f "${RESOLVED_LANGUAGES_FILE}" ]; then
echo "::error file=src/resolved-languages.json::The resolved-languages.json file is missing."
exit 1
fi
#
# Please update getStoredSupportedLanguageMap() when you update the
# following call to use --filter-to-languages-with-queries.
#
"${CODEQL}" resolve languages --format=betterjson --extractor-include-aliases > resolved-languages.json
if ! diff -u resolved-languages.json "${RESOLVED_LANGUAGES_FILE}"; then
echo "::error file=src/resolved-languages.json::The saved resolved-languages.json file is out of date."
exit 1
fi
- name: Upload resolved languages file for debugging
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: resolved-languages
path: resolved-languages.json
env:
CODEQL_ACTION_TEST_MODE: true