Skip to content

Commit 5835751

Browse files
committed
Improve branch extraction naming, add npm scripts to bump docker tags
1 parent 7102667 commit 5835751

File tree

5 files changed

+7
-18
lines changed

5 files changed

+7
-18
lines changed

action.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ inputs:
5858
runs:
5959
using: 'composite'
6060
steps:
61-
# - name: Extract tag to use for docker image
62-
# if: runner.os == 'Linux'
63-
# shell: bash
64-
# run: |
65-
# GIT_REF="${{ github.action_ref }}"
66-
# if [[ "$GIT_REF" == refs/tags/* ]]; then
67-
# DOCKER_TAG=${REF#refs/tags/}
68-
# elif [[ "$GIT_REF" == refs/heads/* ]]; then
69-
# DOCKER_TAG=${GIT_REF#refs/heads/}
70-
# else
71-
# DOCKER_TAG="master"
72-
# fi
73-
# echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV
74-
7561
# For actions running on a linux runner, we use a docker
7662
# approach as it's faster and encapsulates everything needed
7763
# to run the action.

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123585,7 +123585,7 @@ module.exports = JSON.parse('{"eN":{"H":"https://github.com/elastic/require-in-t
123585123585
/***/ ((module) => {
123586123586

123587123587
"use strict";
123588-
module.exports = JSON.parse('{"name":"action-release","version":"1.10.5","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"start":"node dist/index.js","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","test":"jest","all":"yarn run format && yarn run lint && yarn run build && yarn test"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^1.11.1","@sentry/node":"^8.54.0","@sentry/cli":"^2.41.1"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^20.8.9","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.1.0","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"volta":{"node":"18.17.0","yarn":"1.22.4"}}');
123588+
module.exports = JSON.parse('{"name":"action-release","version":"1.10.5","private":true,"description":"GitHub Action for creating a release on Sentry","main":"dist/index.js","scripts":{"start":"node dist/index.js","build":"ncc build src/main.ts -e @sentry/cli","format":"prettier --write **/*.ts **/*.md","format-check":"prettier --check **/*.ts **/*.md","lint":"eslint src/**/*.ts","test":"jest","all":"yarn run format && yarn run lint && yarn run build && yarn test","bump-docker-tag":"./scripts/set-docker-tag.sh","bump-docker-tag-from-branch":"./scripts/set-branch-docker-tag.sh"},"repository":{"type":"git","url":"git+https://github.com/getsentry/action-release.git"},"keywords":["actions","sentry","release"],"author":"Sentry","license":"MIT","dependencies":{"@actions/core":"^1.11.1","@sentry/node":"^8.54.0","@sentry/cli":"^2.41.1"},"devDependencies":{"@types/jest":"^29.5.6","@types/node":"^20.8.9","@typescript-eslint/parser":"^6.9.0","@vercel/ncc":"^0.38.1","eslint":"^8.52.0","eslint-plugin-github":"^4.10.1","eslint-plugin-jest":"^27.4.3","jest":"^29.7.0","jest-circus":"^29.7.0","js-yaml":"^4.1.0","prettier":"^3.0.3","ts-jest":"^29.1.1","typescript":"^5.2.2"},"volta":{"node":"18.17.0","yarn":"1.22.4"}}');
123589123589

123590123590
/***/ })
123591123591

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"format-check": "prettier --check **/*.ts **/*.md",
1212
"lint": "eslint src/**/*.ts",
1313
"test": "jest",
14-
"all": "yarn run format && yarn run lint && yarn run build && yarn test"
14+
"all": "yarn run format && yarn run lint && yarn run build && yarn test",
15+
"bump-docker-tag": "./scripts/set-docker-tag.sh",
16+
"bump-docker-tag-from-branch": "./scripts/set-branch-docker-tag.sh"
1517
},
1618
"repository": {
1719
"type": "git",

scripts/craft-pre-release.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ npm version "${NEW_VERSION}"
1818
yarn install && yarn build
1919

2020
# Update the docker tag in action.yml
21-
./scripts/set-docker-tag $NEW_VERSION
21+
yarn bump-docker-tag "${NEW_VERSION}"

scripts/set-branch-docker-tag.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22
set -eux
33

4-
BRANCH=$(git rev-parse --abbrev-ref HEAD)
4+
# Extract the branch name from git and replace all non-alphanumerical characters with `-`
5+
BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9-]/-/g')
56

67
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
78
cd $SCRIPT_DIR

0 commit comments

Comments
 (0)