Skip to content
Merged
Changes from all commits
Commits
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
14 changes: 5 additions & 9 deletions .github/workflows/superset-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,17 @@ jobs:
- name: Fetch base ref and create comparison worktree
if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true'
env:
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# The checkout above does not persist credentials, and an anonymous
# fetch only works against a public repository. Authenticate this
# one fetch so the comparison also works in private forks/mirrors.
AUTH_HEADER="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\n')"
# For PRs use the base branch; for direct pushes compare against the previous commit.
BASE_REF="$PR_BASE_REF"
if [ -n "$BASE_REF" ]; then
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=1 origin "$BASE_REF"
else
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=2 origin "$GITHUB_REF"
fi
git worktree add /tmp/base-worktree FETCH_HEAD
# Compare against the first parent of the checked-out commit: the
# base commit the PR merge ref was built on, or the previous commit
# for a direct push.
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=2 origin "$GITHUB_SHA"
git worktree add /tmp/base-worktree "$GITHUB_SHA^1"
Comment thread
aozmekik marked this conversation as resolved.
Resolved

# Run babel_update against BASE source + BASE translations. Any drift
# already present on the base branch (source strings that have changed
Expand Down
Loading