From 980ab9c062899751859d656f316a0eb7e57bd466 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Jun 2021 16:28:40 -0500 Subject: [PATCH] [Localization] Pulling New Localization Translations 907643610 (#11839) * [Tests] Fix intro tests on older macOS (#11736) Co-authored-by: Rolf Bjarne Kvinge * Seeing if pushing to this lego branch will create a PR inside AutomatingLocalizationGHATest * [Actions] Remove broken action. (#11819) Actions that are triggered from forks do not have access to the secrets making the action fail most of the time. We have moved to a github action in the static page repo that will clean results of closed PRs everyday. We remove this action because is broken and not needed. * try again * let's get the lego firing again * fire lego #3 * see if test gha occurs * trying after changing gha name * changing the branch (#11826) Co-authored-by: tj_devel709 * after changing the GHA in main * perhaps the action was not updated yet * after merge main * wrong label * fire * adding sync to this branch * fixing env variable * conditionals in the wrong place * add debugging * more debugging * changing the label requirement for the tests * more debugging 2 * try more debugging Co-authored-by: Manuel de la Pena Co-authored-by: Rolf Bjarne Kvinge Co-authored-by: tj_devel709 Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> --- .github/workflows/localization_branch_sync.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/localization_branch_sync.yml b/.github/workflows/localization_branch_sync.yml index d6d264df1db3..08aa786f8621 100644 --- a/.github/workflows/localization_branch_sync.yml +++ b/.github/workflows/localization_branch_sync.yml @@ -9,6 +9,9 @@ jobs: print_info: name: 'Print Information' runs-on: ubuntu-latest + env: + # We want to do the sync if we merged the pull request, the author was 'github-actions', and it has the correct label + FROM_LEGO: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' }} # && contains(github.event.pull_request.labels.*.names, 'localization_bot') }} steps: - name: "Get Pull Request Status" run: | @@ -34,6 +37,9 @@ jobs: - name: "login is correct" run: | echo "${{ github.event.pull_request.user.login == 'github-actions[bot]' }}" + - name: "Can we access the variable?" + run: | + echo "${{ env.FROM_LEGO == true }}" delete_branch: name: 'Delete Localization branch' @@ -44,7 +50,7 @@ jobs: steps: - uses: dawidd6/action-delete-branch@v3 name: 'delete' - if: ${{ env.FROM_LEGO == true }} + if: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' }} # && contains(github.event.pull_request.labels.*.names, 'localization_bot') }} with: github_token: ${{ secrets.GITHUB_TOKEN }} branches: AutomatingLocalizationGHATest2 @@ -58,7 +64,7 @@ jobs: steps: - uses: actions/checkout@v2 name: 'checkout' - if: ${{ env.FROM_LEGO == true }} + if: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' }} # && contains(github.event.pull_request.labels.*.names, 'localization_bot') }} with: repository: ${{ github.repository }} ref: 'AutomatingLocalizationGHATest2' @@ -72,7 +78,7 @@ jobs: steps: - uses: ad-m/github-push-action@master name: push - if: ${{ env.FROM_LEGO == true }} + if: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' }} # && contains(github.event.pull_request.labels.*.names, 'localization_bot') }} with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: 'AutomatingLocalizationGHATest2'