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

More templating #14

Merged
merged 38 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
afcd75b
Invoke reusable workflows
thunderbirdgit Aug 28, 2024
24fb672
Update precommit.yml
thunderbirdgit Aug 28, 2024
2182539
Update precommit.yml
thunderbirdgit Aug 28, 2024
c26de3f
Trigger on all branches push event
thunderbirdgit Aug 28, 2024
d13255f
Fix yaml file
thunderbirdgit Aug 28, 2024
91eeb68
Update precommit.yml
thunderbirdgit Aug 28, 2024
b69b52a
Update precommit.yml
thunderbirdgit Aug 28, 2024
ea0fd65
Update precommit.yml
thunderbirdgit Aug 28, 2024
1ee83a7
Update precommit.yml
thunderbirdgit Aug 28, 2024
3557855
Update precommit.yml
thunderbirdgit Aug 28, 2024
69bab1d
Update precommit.yml
thunderbirdgit Aug 28, 2024
63e0c9f
Update precommit.yml
thunderbirdgit Aug 28, 2024
53ba78a
Update precommit.yml
thunderbirdgit Aug 28, 2024
d0b1efe
Update precommit.yml
thunderbirdgit Aug 28, 2024
2801b71
Update precommit.yml
thunderbirdgit Aug 28, 2024
76e3835
Update precommit.yml
thunderbirdgit Aug 28, 2024
4f39874
Update precommit.yml
thunderbirdgit Aug 28, 2024
8c26985
Update precommit.yml
thunderbirdgit Aug 28, 2024
af5bf41
Update precommit.yml
thunderbirdgit Aug 28, 2024
077dff4
Update precommit.yml
thunderbirdgit Aug 28, 2024
fd3514d
Update precommit.yml
thunderbirdgit Aug 28, 2024
2bccf9f
Update precommit.yml
thunderbirdgit Aug 28, 2024
873c800
Update precommit.yml
thunderbirdgit Aug 28, 2024
b80dea4
Update precommit.yml
thunderbirdgit Aug 28, 2024
e209cd4
Update precommit.yml
thunderbirdgit Aug 28, 2024
78be1c4
Update precommit.yml
thunderbirdgit Aug 28, 2024
721f5a3
Update precommit.yml
thunderbirdgit Aug 28, 2024
90349a6
Update precommit.yml
thunderbirdgit Aug 28, 2024
d976979
Update precommit.yml
thunderbirdgit Aug 28, 2024
0663279
Update precommit.yml
thunderbirdgit Aug 28, 2024
f9c158d
Update precommit.yml
thunderbirdgit Aug 28, 2024
d10991e
Trigger if PR is merged
thunderbirdgit Aug 28, 2024
82ff843
Update precommit.yml
thunderbirdgit Aug 28, 2024
6849a12
Merge branch 'main' into invoketemplatewf
thunderbirdgit Aug 28, 2024
6cef557
Update precommit.yml
thunderbirdgit Aug 28, 2024
a4554a3
Update precommit.yml
thunderbirdgit Aug 28, 2024
bf9ae0e
Update precommit.yml
thunderbirdgit Aug 28, 2024
02e1ae6
Merge branch 'main' into invoketemplatewf
thunderbirdgit Aug 28, 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
39 changes: 3 additions & 36 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,11 @@ on:
jobs:
# Determine the branch name to append to docker image
determine-branch:
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.get_branch.outputs.branch_name }}
steps:
- name: Get Branch Name
id: get_branch
run: |
if [ "${{ github.event_name }}" == "push" ]; then
branch_name=${GITHUB_REF#refs/heads/}
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "branch_name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
fi

- name: Print Final Branch Name
run: |
echo "Branch Name: ${{ steps.get_branch.outputs.branch_name }}"
uses: thunderbirdgit/gh-actions-wf/.github/workflows/get-branch-name.yml@main

# Get the short SHA to append to docker image
get-short-sha:
runs-on: ubuntu-latest
outputs:
short_sha: ${{ steps.get_sha.outputs.short_sha }}
steps:
- name: Show Short Git SHA
id: get_sha
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" == "pull_request" ]; then
echo "short_sha=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
else
echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
fi

- name: Print Short Git SHA
run: |
echo "Git SHA: ${{ steps.get_sha.outputs.short_sha }}"
uses: thunderbirdgit/gh-actions-wf/.github/workflows/get-short-sha.yml@main

build:
strategy:
Expand All @@ -60,4 +27,4 @@ jobs:
with:
service_name: ${{matrix.service_name}}
short_sha: ${{ needs.get-short-sha.outputs.short_sha }}
branch_name: ${{ needs.determine-branch.outputs.branch_name }}
branch_name: ${{ needs.determine-branch.outputs.branch_name }}