mirror of
https://github.com/google/blockly.git
synced 2026-01-15 04:47:10 +01:00
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
# This workflow updates the check_metadata.sh script, which compares the current
|
|
# size of build artifacts against their size in the previous version of Blockly.
|
|
|
|
name: Update Metadata
|
|
|
|
on: [workflow_dispatch]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
update-metadata:
|
|
permissions:
|
|
contents: write # for peter-evans/create-pull-request to create branch
|
|
pull-requests: write # for peter-evans/create-pull-request to create a PR
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check Out Blockly
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: 'develop'
|
|
|
|
- name: Use Node.js 16.x
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 16.x
|
|
|
|
- name: Build Blockly
|
|
run: npm run build:compressed
|
|
|
|
- name: Build Blockly blocks
|
|
run: npm run build:blocks
|
|
|
|
- name: Update Metadata
|
|
run: source ./tests/scripts/update_metadata.sh
|
|
|
|
- name: Create Pull Request
|
|
uses: peter-evans/create-pull-request@9825ae65b1cb54b543b938503728b432a0176d29
|
|
with:
|
|
commit-message: Update build artifact sizes in check_metadata.sh
|
|
delete-branch: true
|
|
title: Update build artifact sizes in check_metadata.sh
|
|
|
|
- name: View Pull Request
|
|
run: echo "View Pull Request - ${{ steps.cpr.outputs.pull-request-url }}" |