Skip to content

Commit

Permalink
Use GH API
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Mar 13, 2024
1 parent ee65489 commit 2c098b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }}
# Elevated permissions token is needed here or otherwise GitHub
# blocks pushing the hotfix branch without `workflows` permission.
# Elevated permissions token is needed here to use GH git/refs API (used by fastlane)
GH_TOKEN: ${{ secrets.GHA_ELEVATED_PERMISSIONS_TOKEN }}
run: |
git config --global user.name "Dax the Duck"
Expand Down
11 changes: 8 additions & 3 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,14 @@ release in progress and you're making a follow-up internal release that includes
).empty?

# Create the branch and push
Action.sh('git', 'fetch', '--tags')
Action.sh('git', 'checkout', '-b', release_branch, source_version)
Action.sh('git', 'push', '-u', 'origin', release_branch)
if is_ci
sha = Action.sh('git', 'rev-parse', source_version).chomp
Action.sh('gh', 'api', '--method', 'POST', '/repos/duckduckgo/macos-browser/git/refs', '-f', "ref=refs/heads/#{release_branch}", '-f', "sha=#{sha}")
else
Action.sh('git', 'fetch', '--tags')
Action.sh('git', 'checkout', '-b', release_branch, source_version)
Action.sh('git', 'push', '-u', 'origin', release_branch)
end
end

# Updates embedded files:
Expand Down

0 comments on commit 2c098b7

Please sign in to comment.