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

refactor: extracted action #107

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b086eaf
refactor: extracted action
mfranzke Sep 16, 2024
18a23cd
feat: added extracted action
mfranzke Sep 16, 2024
ee76754
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Sep 16, 2024
f3714d3
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Sep 16, 2024
5fa2c63
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Sep 16, 2024
941880d
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Sep 16, 2024
4ce9893
Update action.yml
mfranzke Sep 16, 2024
de0e952
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Sep 19, 2024
04f5c12
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
080d7eb
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
47f457d
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
ddea8d7
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
ca678ee
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
b545da2
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
cc7d570
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
d74b9a2
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Oct 23, 2024
b11662d
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Dec 11, 2024
e1bdbcc
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Dec 11, 2024
af25781
Merge branch 'main' into refactor-bundle-gh-page
github-actions[bot] Dec 11, 2024
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
3 changes: 1 addition & 2 deletions .github/actions/bundle-gh-page/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ runs:
using: "composite"
steps:
- name: ↔ Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
uses: ./.github/actions/extract-branch
id: extract_branch
- name: ➕ Create temp or public dir
run: |
Expand Down
27 changes: 27 additions & 0 deletions .github/actions/extract-branch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "Extract branch name"
description: "Extract branch name based on pr or push"
outputs:
branch-name:
description: "Branch name"
value: ${{ steps.branch-name.outputs.branch-name }}
runs:
using: "composite"
steps:
- name: ⏬ Get branch name
uses: actions/github-script@v6
id: get-branch-name
with:
result-encoding: string
script: |
return (
context?.payload?.pull_request?.head?.ref ||
context?.payload?.ref || ""
).replace("refs/heads/","");

- name: 🪑 Set output
id: branch-name
run: echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT
shell: bash
env:
BRANCH_NAME: ${{steps.get-branch-name.outputs.result}}