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: CUS-1729 GitHub actions for publishing #6

Merged
merged 2 commits into from
Feb 26, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build and Test
on:
push:
branches-ignore:
- main
jobs:
test:
runs-on: ubuntu-latest
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
increment-version:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -18,10 +18,23 @@ jobs:
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Get GH Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_RELEASE_APP_ID }}
private-key: ${{ secrets.GH_RELEASE_APP_PRIVATE_KEY }}
- name: Increment version
uses: chainguard-dev/actions/setup-gitsign@main
shell: bash
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
# Temporarily commenting out setting the git user.name and user.email to try the gitsign action which set these for signing commits.
# https://www.chainguard.dev/unchained/keyless-git-commit-signing-with-gitsign-and-github-actions - not recommended for private repos
# git config user.name "datadogclientjsrepopush[bot]"
# git config user.email "161316041+datadogclientjsrepopush[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token/:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}
npm version ${{ github.event.release.tag_name }} -m "[ci skip] v%s"
git tag -af ${{ github.event.release.tag_name }} -m "[ci skip] v%s"
git push
Expand Down