From e156e7b2aefcabfe084c1bddbc31261ae802336f Mon Sep 17 00:00:00 2001 From: Tyler Milner Date: Mon, 8 Apr 2024 01:36:47 -0500 Subject: [PATCH 1/3] Add automated release publishing workflow based on https://docs.github.com/en/actions/creating-actions/releasing-and-maintaining-actions#setting-up-github-actions-workflows and https://github.com/github-developer/javascript-action/blob/main/.github/workflows/publish.yml. --- .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ package.json | 1 + 2 files changed, 25 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..13c816b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish + +on: + release: + types: [published, edited] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Setup Node + uses: actions/setup-node@v4 + + # Compile dist/index.js and bundle with action.yml + # Force push major and minor tags, e.g. v1, v1.0 + # See documentation: https://github.com/JasonEtco/build-and-tag-action + - uses: JasonEtco/build-and-tag-action@v2 + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/package.json b/package.json index d2f00eb..fb38e47 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "1.0.1", "author": "Tyler Milner", "private": true, + "main": "dist/index.js", "homepage": "https://github.com/tylermilner/last-successful-commit-hash-action#readme", "repository": { "type": "git", From dd52c4e37e0de2570d1ce0c8a04bca049b5e612c Mon Sep 17 00:00:00 2001 From: Tyler Milner Date: Mon, 8 Apr 2024 01:46:01 -0500 Subject: [PATCH 2/3] Set `publish` workflow permissions to `read-all` to fix CKV2_GHA_1: "Ensure top-level permissions are not set to write-all" linter error. --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 13c816b..3971812 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,8 @@ on: release: types: [published, edited] +permissions: read-all + jobs: publish: runs-on: ubuntu-latest From c0bc604a6724c9cf5db7a200318d54bd1c085c9b Mon Sep 17 00:00:00 2001 From: Tyler Milner Date: Mon, 8 Apr 2024 01:50:52 -0500 Subject: [PATCH 3/3] Setup CHANGELOG for `v1.0.1-beta.1` release. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8592c9..83319e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to ## [Unreleased] +## [1.0.1-beta.1] - 2024-04-08 + ### Added - Added comments for `main.js` @@ -28,6 +30,8 @@ and this project adheres to [unreleased]: https://github.com/tylermilner/last-successful-commit-hash-action/compare/v1.0.0...HEAD +[1.0.1-beta.1]: + https://github.com/tylermilner/last-successful-commit-hash-action/compare/v1.0.0...v1.0.1-beta.1 [1.0.0]: https://github.com/tylermilner/last-successful-commit-hash-action/releases/tag/v1.0.0