Skip to content

Commit 61d8955

Browse files
authored
refactor: adapted pipeline script parts (#102)
from db-ui/elements@d07fae2
1 parent a9d09ab commit 61d8955

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: "Extract branch name"
3+
description: "Extract branch name based on pr or push"
4+
outputs:
5+
branch-name:
6+
description: "Branch name"
7+
value: ${{ steps.branch-name.outputs.branch-name }}
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: ⏬ Get branch name
12+
uses: actions/github-script@v6
13+
id: get-branch-name
14+
with:
15+
result-encoding: string
16+
script: |
17+
return (
18+
context?.payload?.pull_request?.head?.ref ||
19+
context?.payload?.ref
20+
).replace("refs/heads/","");
21+
- name: 🪑 Set output
22+
id: branch-name
23+
run: echo "::set-output name=branch-name::$(echo $BRANCH_NAME)"
24+
shell: bash
25+
env:
26+
BRANCH_NAME: ${{steps.get-branch-name.outputs.result}}

.github/scripts/build-gh-page.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616

1717

1818
echo "📥 Get gh-pages tar"
19-
curl -L https://github.com/db-ui/base/tarball/gh-pages --output gh-pages
19+
curl -L https://github.com/"$OWNER_NAME"/"$REPO_NAME"/tarball/gh-pages --output gh-pages
2020

2121
echo "📦 Unpack Tar"
2222
if [[ $RELEASE == "true" ]]; then

.github/workflows/00-scan-secrets.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ jobs:
1313
fetch-depth: 0
1414

1515
- name: ↔ Extract branch name
16-
shell: bash
17-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
16+
uses: ./.github/actions/extract-branch
1817
id: extract_branch
1918

2019
- name: 🐷 TruffleHog OSS
2120
uses: trufflesecurity/[email protected]
2221
with:
2322
path: ./
24-
base: ${{ steps.extract_branch.outputs.branch }}
23+
base: ${{ steps.extract_branch.outputs.branch-name }}
2524
head: HEAD
2625

2726
- name: 💀 Killing me softly

0 commit comments

Comments
 (0)