Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ on:
paths:
- "docs/examples/demo/*"

permissions: {}

jobs:
cpp-linter:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -28,7 +31,9 @@ jobs:

- name: Fail fast?!
if: steps.linter.outputs.checks-failed != 0
env:
CHECKS_FAILED: ${{ steps.linter.outputs.checks-failed }}
run: |
echo "some linter checks failed. ${{ steps.linter.outputs.checks-failed }}"
echo "some linter checks failed. ${CHECKS_FAILED}"
# for actual deployment
# run: exit 1
7 changes: 7 additions & 0 deletions .github/workflows/mkdocs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ on:
branches: [main]
workflow_dispatch:

permissions: {}

jobs:
build-docs:
permissions:
contents: read
# to deploy to Pages (only on the main branch)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing the reusable workflow only deploys on main branch and not for pull requests targeting main branch.

I say this because there is no condition in this calling workflow to prevent deploying docs on pull requests.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. The reusable workflow's deploy job has if: github.ref == 'refs/heads/main', so on PRs only build runs (you can see build-docs / deploy was skipped on this PR). A caller still has to grant pages/id-token up front because it can't scope permissions to individual jobs inside a reusable workflow.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also scope deployments to a gh-pages environment (for hardened security), but that would require all org repos that call the workflow have a gh-pages environment setup (and allowed to run on main branch)

pages: write
id-token: write
uses: cpp-linter/.github/.github/workflows/mkdocs.yml@main
4 changes: 4 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [main]

permissions: {}

jobs:
pre-commit:
permissions:
contents: read
uses: cpp-linter/.github/.github/workflows/pre-commit.yml@main
10 changes: 6 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ jobs:
git config user.name 'github-actions'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Update rolling tag
env:
INPUT_TAG: ${{ inputs.tag }}
run: |
# Get the major version from the latest tag
MAJOR_VERSION=`git tag --list --sort=-v:refname | head -n1 | cut -d. -f1`
git tag --force --annotate ${{ inputs.tag || '$MAJOR_VERSION' }} --message 'Retag ${{ inputs.tag || '$MAJOR_VERSION' }}'
git push origin ${{ inputs.tag || '$MAJOR_VERSION' }} --force
# Use the tag given by hand, else the major version of the latest tag
TAG="${INPUT_TAG:-$(git tag --list --sort=-v:refname | head -n1 | cut -d. -f1)}"
git tag --force --annotate "$TAG" --message "Retag $TAG"
git push origin "$TAG" --force
Loading