-
Notifications
You must be signed in to change notification settings - Fork 122
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
[WIP] IEP-1042: Run the installer action with the publishing of release on idf-eclipse-plugin github page #836
base: master
Are you sure you want to change the base?
Changes from all commits
81fe82a
e4522a4
038481f
cc4a0a6
415157f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: run_idf_installer_build | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
pull_request: | ||
|
||
jobs: | ||
run-idf-installer-build: | ||
name: IDF Installer Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get IDE version from release tag | ||
run: | | ||
TAG=${{ github.event.release.tag_name }} | ||
IDE_VERSION=${TAG#v} | ||
echo "IDE Version is $IDE_VERSION" | ||
echo "IDE_VERSION=$IDE_VERSION" >> $GITHUB_ENV | ||
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The IDE version extraction assumes the tag starts with 'v'. If this is not always the case, the script may fail to extract the correct version. A check should be added to ensure the tag starts with 'v' before stripping it. |
||
|
||
- name: Get latest release from espressif/esp-idf | ||
run: | | ||
RESPONSE=$(curl -L \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: Bearer ${{ secrets.REPO_ACCESS_TOKEN }}" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
https://api.github.com/repos/espressif/esp-idf/releases/latest) | ||
|
||
TAG_NAME=$(echo "$RESPONSE" | jq -r '.tag_name') | ||
IDF_VERSION=${TAG_NAME#v} | ||
echo "Latest IDF Version is: $IDF_VERSION" | ||
echo "IDF_VERSION=$IDF_VERSION" >> $GITHUB_ENV | ||
Comment on lines
+27
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a personal access token with potentially broad permissions could be a security risk. Ensure that the token used has the minimum required permissions, or consider fetching the release without authentication if possible.
Comment on lines
+33
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script assumes that the IDF version tag will always start with 'v'. If this is not always the case, the script may fail to extract the correct version. A check should be added to ensure the tag starts with 'v' before stripping it. |
||
|
||
|
||
- name: Trigger the Receiver Action | ||
run: | | ||
curl -X POST \ | ||
-H "Authorization: Bearer ${{ secrets.REPO_ACCESS_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/espressif/idf-installer/actions/workflows/build-espressif-ide-installer.yml/dispatches \ | ||
-d '{ | ||
"ref": "main", | ||
"inputs": { | ||
"espressif_ide_version": "'$IDE_VERSION'", | ||
"esp_idf_version": "'$IDF_VERSION'", | ||
"python_version": "3.11" | ||
} | ||
}' | ||
Comment on lines
+41
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script uses a personal access token to trigger the Receiver Action. Ensure that the token used has the minimum required permissions to mitigate security risks. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
pull_request
trigger does not specify event types. If the intention is to run the workflow for all pull request events, the colon afterpull_request
should be removed. If specific event types are desired, they need to be listed.Committable suggestion