Skip to content

Commit

Permalink
fix: default source commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ARR4N committed Oct 11, 2024
1 parent 5254b44 commit 831279d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/rename-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,22 @@ on:
description: 'Upstream commit on which to base module renaming'
required: true
type: string
default: '2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1'
default: ''

jobs:
rename-module:
runs-on: ubuntu-latest
env:
output_branch: "${{ github.ref_name }}_auto-rename-module-${{ inputs.source_commit }}"
source_commit: ${{ inputs.source_commit || '2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1' }}
output_branch: "${{ github.ref_name }}_auto-rename-module-${{ env.source_commit }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # everything
fetch-tags: true

- name: Check out source commit
run: git checkout ${{ inputs.source_commit }}
- name: Check out source commit `{{ $env.source_commit }}`
run: git checkout ${{ env.source_commit }}

- name: Globally update module name
run: |
Expand Down Expand Up @@ -62,11 +63,11 @@ jobs:
commit_prefix: "[AUTO] rename Go module + update internal import paths"

- name: Open PR to "renamed-go-module" iff workflow dispatched on "main"
# if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.output_branch }}
target_branch: renamed-go-module
title: "[AUTO] Rename upstream Go module at `${{ inputs.source_commit }}`"
title: "[AUTO] Rename upstream Go module at `${{ env.source_commit }}`"
body: "_PR generated by GitHub Action_"

0 comments on commit 831279d

Please sign in to comment.