Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaceb2c

Browse files
authored
Merge pull request actions#177 from brcrista/main
Create check-dist.yml
2 parents 4294354 + 5ed343d commit aaceb2c

File tree

2 files changed

+58
-11
lines changed

2 files changed

+58
-11
lines changed

.github/workflows/check-dist.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# `dist/index.js` is a special file in Actions.
2+
# When you reference an action with `uses:` in a workflow,
3+
# `index.js` is the code that will run.
4+
# For our project, we generate this file through a build process
5+
# from other source files.
6+
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
7+
name: Check dist/
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
paths-ignore:
14+
- '**.md'
15+
pull_request:
16+
paths-ignore:
17+
- '**.md'
18+
workflow_dispatch:
19+
20+
jobs:
21+
check-dist:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set Node.js 12.x
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: 12.x
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Rebuild the dist/ directory
36+
run: npm run build
37+
38+
- name: Compare the expected and actual dist/ directories
39+
run: |
40+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
41+
echo "Detected uncommitted changes after build. See status below:"
42+
git diff
43+
exit 1
44+
fi
45+
id: diff
46+
47+
# If index.js was different than expected, upload the expected version as an artifact
48+
- uses: actions/upload-artifact@v2
49+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
50+
with:
51+
name: dist
52+
path: dist/

.github/workflows/licensed.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,23 @@ name: Licensed
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [main]
8-
repository_dispatch:
9-
workflow_dispatch:
8+
branches:
9+
- main
1010

1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
1414
name: Check licenses
1515
steps:
1616
- uses: actions/checkout@v2
17-
- uses: actions/cache@v2
18-
with:
19-
path: ~/.npm
20-
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
21-
restore-keys: ${{runner.os}}-npm-
2217
- run: npm ci
2318
- name: Install licensed
24-
run: |-
19+
run: |
2520
cd $RUNNER_TEMP
26-
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.9.2/licensed-2.9.2-linux-x64.tar.gz
21+
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
2722
sudo tar -xzf licensed.tar.gz
2823
sudo mv licensed /usr/local/bin/licensed
2924
- run: licensed status

0 commit comments

Comments
 (0)