Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace the version by hash value and add permissions #3223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: replace the version by hash value and add permissions
Fix3dP0int committed Dec 20, 2024
commit d572e58754d563680ecbed20bdcdebcef94944f8
66 changes: 34 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: CI

permissions: read-all

on:
push:
branches: [ master ]
@@ -13,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
name: Build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
@@ -39,19 +41,19 @@ jobs:
mv html2canvas-*.tgz html2canvas.tgz
tar --list --verbose --file=html2canvas.tgz
- name: Upload npm pack
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: npm
path: html2canvas.tgz
if-no-files-found: error
- name: Upload dist
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: dist
path: dist
if-no-files-found: error
- name: Upload build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: build
path: build
@@ -61,12 +63,12 @@ jobs:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
@@ -136,12 +138,12 @@ jobs:
TARGET_BROWSER: ${{ matrix.config.targetBrowser }}
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
@@ -155,12 +157,12 @@ jobs:
- name: Npm install
run: npm ci
- name: Download library
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: dist
path: dist
- name: Download test-runner
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: build
path: build
@@ -177,7 +179,7 @@ jobs:
if: ${{ matrix.config.xvfb == true }}
run: DISPLAY=:99 npm run karma
- name: Upload screenshots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: reftest-results
path: tmp/reftests
@@ -188,14 +190,14 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
needs: browser-test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Download NPM package
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: npm
path: npm
- name: Download library
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: dist
path: dist
@@ -238,7 +240,7 @@ jobs:
asset_content_type: text/javascript
- name: Unpack npm
run: cd npm && tar -xvzf "html2canvas.tgz"
- uses: actions/setup-node@v1
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
@@ -251,12 +253,12 @@ jobs:
name: Build docs
needs: browser-test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
@@ -270,12 +272,12 @@ jobs:
- name: Npm install
run: npm ci
- name: Download library
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: dist
path: www/static/dist
- name: Download test results
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: reftest-results
path: www/static/results
@@ -290,7 +292,7 @@ jobs:
- name: Build docs
run: npm run build && cd www && npm install && npm run build && cd ..
- name: Upload docs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: docs
path: www/public
@@ -301,11 +303,11 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
needs: docs
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Download docs
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: docs
path: docs
@@ -322,14 +324,14 @@ jobs:
name: Diff reftest screenshots
needs: browser-test
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Cache node modules
uses: actions/cache@v2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
cache-name: cache-node-modules
with:
@@ -345,15 +347,15 @@ jobs:
- name: Checkout current snapshots
run: git checkout origin/gh-pages results
- name: Download test results
uses: actions/download-artifact@v2
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: reftest-results
path: tmp/reftests
- name: Run diff
run: npm run reftests-diff
continue-on-error: true
- name: Upload diff
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
with:
name: snapshot-diffs
path: tmp/snapshot-diffs
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Create Release

permissions: read-all

on:
workflow_dispatch:
inputs:
version:
description: 'Semantic version (major | minor | patch | premajor | preminor | prepatch | prerelease)'
default: 'patch'
required: true

jobs:
version:
name: Create version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- uses: actions/setup-node@v1
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 12
- name: Npm install