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

Contents is not getting updated once the files are synced and pushed to target repository #22

Open
swathida-byte opened this issue Oct 3, 2022 · 9 comments

Comments

@swathida-byte
Copy link

swathida-byte commented Oct 3, 2022

@varunsridharan Once the file is synced and updated in the target repository and when the changes are made in the script and updated and when the changes are pushed to the target repository it's not getting updated.

For example:
abc.sh in beginning
echo "hi"
abc.sh in target repo
echo "hi"

abc.sh after updating
echo "hello"
abc.sh in target repo after updating
echo "hi"

workflow file used

on:
  push:
    branches:
      - "main"
env:
  DRY_RUN: false
  REPOSITORIES: |
    QE/yarn-qe@github-actions-poc
  WORKFLOW_FILES: |
    yarn-qe/approval.yaml=.github/workflows/pr-approval.yaml
    yarn-qe/qe-check.yaml=.github/workflows/qe-check.yaml
    yarn-qe/qe-ci-gate-qe-gate.yaml=.github/workflows/qe-ci-gate-qe-gate.yaml
    .github/qaas-jobs/static-analysis.sh=.github/static-analysis.sh
    .github/qaas-jobs/commit_message_check.sh=.github/commit_message_check.sh
    .github/qaas-jobs/docker-build-system_test.sh=.github/docker-build-system_test.sh
    .github/qaas-jobs/docker-build-temp-image-system_test.sh=.github/docker-build-temp-image-system_test.sh
jobs:
  Github_Workflow_Sync:
    runs-on: [re-centos7]
    steps:
      - name: Fetching Local Repository
        uses: actions/checkout@v2
      - name: Running Workflow Sync
        uses: Kitchen/RE-thirdparty-actions/actions/workflow-sync@main
        with:
          DRY_RUN: ${{ env.DRY_RUN }}
          REPOSITORIES: ${{ env.REPOSITORIES }}
          WORKFLOW_FILES: ${{ env.WORKFLOW_FILES }}
          GITHUB_TOKEN: ${{ secrets.RE_JENKINS_GH_USER_TOKEN }}
          PULL_REQUEST: true
          GIT_URL: ***
          COMMIT_MESSAGE: "Sync workflow files | Triggered by Kitchen/RE-github-workflows"```
@varunsridharan
Copy link
Owner

@swathida-byte can you please provide the action's log and what kind of error it states ?

Also are you trying to update the file from the master repository where all the files are saved ?
or are you using to update it from secondary repository to master ?

@swathida-byte
Copy link
Author

I'm trying to update file from master where all files are saved

@varunsridharan
Copy link
Owner

varunsridharan commented Oct 7, 2022

@swathida-byte I tried multiple times in my dev env, but it works every time.

Without having access to GitHub action's log, I can't help. Please do share the actions log to assist you furthermore.

@swathida-byte
Copy link
Author

swathida-byte commented Oct 7, 2022

  ✔  .github/QE/qaas-jobs/docker-build-temp-image-system_test.sh => .github/docker-build-temp-image-system_test.sh
 
✔  [github-actions-poc 31b7a39] Sync workflow files | Triggered by **/***
 3 files changed, 16 insertions(+)
 create mode 100644 .github/workflows/pr-approval.yaml
Git Commit & Push Log
---------------------------------------------------
/usr/local/bin/git push *****.git
To https://***/**/qe.git
 ! [remote rejected] github-actions-poc -> github-actions-poc (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/pr-approval.yaml` without `workflow` scope)
error: failed to push some refs to 'https://**/**/qe.git'
---------------------------------------------------

@swathida-byte
Copy link
Author

swathida-byte commented Oct 7, 2022

Can we use regex to mention branch names
QE/yarn-qe@github-actions-poc as QE/yarn-qe@github.*

@varunsridharan
Copy link
Owner

varunsridharan commented Oct 7, 2022

@swathida-byte

Regards to the logs that you have shared, I can see a like

! [remote rejected] github-actions-poc -> github-actions-poc
(refusing to allow a Personal Access Token to create or update workflow `.github/workflows/pr-approval.yaml` 
without `workflow` scope)

in which it clearly states that the access token you have given for the action to commit files requires workflow scope.
Please check here 👉 on how to generate a personal access token with that scope https://github.com/varunsridharan/action-github-workflow-sync#personal-access-token-scope


Regards to 👇

Can we use regex to mention branch names
QE/yarn-qe@github-actions-poc as QE/yarn-qe@github.*

No, this action currently does not support regex. But I do have plans to have support for it.

GitHub
Github Action To Sync Github Action's Workflow Files Across Repositories - GitHub - varunsridharan/action-github-workflow-sync: Github Action To Sync Github Action's Workflow Files Across R...

@swathida-byte
Copy link
Author

When can we expect that regex support release??

@varunsridharan
Copy link
Owner

When can we expect that regex support release??

I don't have any timeline for it, but this feature will be added for sure.

I am not sure what you mean by central repository. Can you share a map as you have set up this action ?

@swathida-byte
Copy link
Author

swathida-byte commented Oct 17, 2022

can you add regex feature, and after that I guess we can close that issue
or should I raise one more request for tracking the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants