mirror of
https://github.com/tobi/disktree.git
synced 2026-11-28 08:00:53 +00:00
ci: read-only token for CI, and the release tag through the environment
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d37870cdea
commit
2ee640a448
@@ -5,6 +5,10 @@ on:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
# Pull requests run here, so the token can read and nothing more.
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ci-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -33,8 +33,12 @@ jobs:
|
||||
|
||||
- name: Version
|
||||
id: version
|
||||
# Through the environment, not spliced into the script: a tag typed
|
||||
# into the dispatch form is text, never shell.
|
||||
env:
|
||||
TAG: ${{ inputs.tag || github.ref_name }}
|
||||
run: |
|
||||
tag="${{ inputs.tag || github.ref_name }}"
|
||||
tag="$TAG"
|
||||
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||||
if [ "$tag" != "v$version" ]; then
|
||||
echo "tag $tag does not match Cargo.toml version $version" >&2
|
||||
@@ -118,8 +122,12 @@ jobs:
|
||||
|
||||
- name: Version
|
||||
id: version
|
||||
# Through the environment, not spliced into the script: a tag typed
|
||||
# into the dispatch form is text, never shell.
|
||||
env:
|
||||
TAG: ${{ inputs.tag || github.ref_name }}
|
||||
run: |
|
||||
tag="${{ inputs.tag || github.ref_name }}"
|
||||
tag="$TAG"
|
||||
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
|
||||
if [ "$tag" != "v$version" ]; then
|
||||
echo "tag $tag does not match Cargo.toml version $version" >&2
|
||||
|
||||
Reference in New Issue
Block a user