Skip to content

chore: Add write permission for contents in GitHub Actions workflow #6

chore: Add write permission for contents in GitHub Actions workflow

chore: Add write permission for contents in GitHub Actions workflow #6

Workflow file for this run

name: Create Tag
on:
push:
branches:
- canary
- master
permissions:
repository-projects: write
contents: write
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Create tag
uses: actions/github-script@v7
with:
script: |
const lernaVersion = require('./lerna.json').version;
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/v${lernaVersion}`,
sha: context.sha,
});
await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `v${lernaVersion}`,
name: `v${lernaVersion}`,
body: `Release v${lernaVersion}`,
target_commitish: context.sha,
prerelease: lernaVersion.includes('canary'),
});
core.setOutput('tag', `v${lernaVersion}`);
core.setOutput('release', `v${lernaVersion}`);