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

fix(workflow): Update permissions in zephyr-hal workflow #994

Merged
merged 4 commits into from
May 13, 2024

Conversation

sihyung-maxim
Copy link
Contributor

Description

Trying new secrets to push the latest MSDK changes into analogdevicesinc/hal_adi.

And trying a new GitHub actions account in the workflow.

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

@github-actions github-actions bot added Workflow Related to Workflow development labels Apr 17, 2024
Copy link
Contributor

@Jake-Carter Jake-Carter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attempted to run a manual test on this branch (https://github.com/analogdevicesinc/msdk/actions/runs/8725113677)

We should also modify the workflow logic to support manual dispatches

@sihyung-maxim
Copy link
Contributor Author

sihyung-maxim commented Apr 17, 2024

Attempted to run a manual test on this branch (https://github.com/analogdevicesinc/msdk/actions/runs/8725113677)

We should also modify the workflow logic to support manual dispatches

Removed conditional - job doesn't get skipped now.

@sihyung-maxim
Copy link
Contributor Author

Looking into a new permissions issue that popped up.

@Jake-Carter
Copy link
Contributor

Nice, now we can test it at least

git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add *
git commit -m "Update Zephyr MSDK Hal based on MSDK PR# ${PR_NUM}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add
https://github.com/analogdevicesinc/msdk/pull/${PR_NUM}
in commit message too, to easily access related MSDK PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. GitHub should also automatically reformat the PR link to #123, for example, as well.

@@ -51,6 +49,7 @@ jobs:
with:
# Specific Branch, tag, or SHA to checkout (uses default branch if empty)
ref: 'develop'
token: ${{ secrets.ZEPHYRHAL }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sihyung-maxim have you tried using ssh-key instead? I recently had some success with it on the MSDKGen repo (see here).

Just need to add the SSH key as a deployment key in the hal_adi repo settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does your SSH key secret hold the private key? If so, I didn't know you use it as a token for actions/checkout. We have an SSH secret (secrets.MSDK_SSH_KEY), but the issue right now is pushing files to a target repo outside the source repo where the action was triggered. I'm not sure if the target repo settings need to update its permissions to allow this or not...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the secret has the private key (I generated a new one just in case it gets compromised somehow) and then I just pass that in as ssh-key.

As long as the key is added as a deploy key to both repos it should work.

image

@Jake-Carter Jake-Carter merged commit adf9d67 into main May 13, 2024
6 checks passed
@Jake-Carter Jake-Carter deleted the fix/zephyrhal_workflow branch May 13, 2024 14:49
push: true
# Specify path in workspace to the repo you want to push to
cwd: './hal_adi'
- name: Push changes to hal_adi repository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sihyung-maxim still seems to be failing (see https://github.com/analogdevicesinc/msdk/actions/runs/9065017493/job/24904593346)

You may want to try adding the SSH link manually and explicitly pushing to it. Should force git to use SSH

git remote add upstream git@github.com:analogdevicesinc/hal_adi.git
git fetch upstream --depth 1
git add *
git commit -m "Update Zephyr MSDK Hal based on MSDK PR: https://github.com/analogdevicesinc/msdk/pull/${PR_NUM}"
git push upstream

EricB-ADI pushed a commit that referenced this pull request Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Workflow Related to Workflow development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants