Skip to content

Commit 7d0f721

Browse files
authored
debug - what is github.ref (#7)
* debug - what is github.ref
1 parent 13b8495 commit 7d0f721

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/actions/release_to_prod/action.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,35 @@ description: "Pretend this released to production"
44
runs:
55
using: "composite"
66
steps:
7+
- name: print out stuff
8+
# on pr
9+
# echo "${{github.ref}}" -> refs/pull/7/merge
10+
# echo "${{github.head_ref}}" -> jblock/gh-debug-1 # but this is only available on `pull_request`, not release
11+
# echo "${{github.ref_name}}" -> 7/merge
12+
# git rev-parse --abbrev-ref HEAD -> HEAD
13+
run: |
14+
echo "${{github.ref}}"
15+
echo "${{github.head_ref}}"
16+
echo "${{github.ref_name}}"
17+
git rev-parse --abbrev-ref HEAD
18+
git branch --show-current
19+
shell: bash
20+
721
- name: Do some release stuff for main
8-
if: github.ref == 'refs/heads/main'
22+
if: github.ref == 'main'
923
run: |
1024
echo "this is the release script for main"
1125
shell: bash
1226

1327

1428
- name: Do some release stuff for a hotfix
15-
if: contains(github.ref, 'hotfix') == true
29+
if: contains(github.head_ref, 'hotfix') == true
1630
run: |
1731
echo "this is the release script for a HOTFIX"
1832
shell: bash
1933

2034
- name: Warn about other branches
21-
if: contains(github.ref, 'hotfix') == false && github.ref != 'refs/head/main'
35+
if: contains(github.head_ref, 'hotfix') == false && github.head_ref != 'main'
2236
run: |
2337
echo "Can only release main or hotfix"
2438
shell: bash

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Release
22

33
on:
4+
# pull_request:
5+
# branches:
6+
# - '*'
7+
48
release:
59
types: [published]
610
paths-ignore:

0 commit comments

Comments
 (0)