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

Create an issue when nightly-ci fails #3080

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

JurajSadel
Copy link
Contributor

closes #3068

I've tested this with another repo, works fine there, hopefully I haven't missed anything. I'm volunteering to work on those nightly issues (I will assign them to myself), I also created a new label ci-nightly that should be assigned to the issue, also already existing issue should be updated automatically so we don't have duplicates - this is at least the theory behind this PR 😆

@JurajSadel JurajSadel added the skip-changelog No changelog modification needed label Jan 31, 2025
@@ -51,3 +51,19 @@ jobs:
device: ${{ matrix.device.soc }}
target: ${{ matrix.device.target }}
toolchain: nightly

create-issue-on-failure:
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't need to be a completely new job I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to play with it but couldn't figure out how to do that without a separate job so I went with easier option :D

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, you could set continue-on-error and then transform your issue job into a steps that checks if: failure() something like that should do the trick I think

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried this? From their docs:

The update_existing param can be passed and set to true when you want to update an open issue with the exact same title when it exists and false if you don't want to create a new issue, but skip updating an existing one.

What is exactly updated? It would be very cool if we had the error message in the issue body, and this update feature added the new errors either in the description or in a new comment, but this doesn't look simple enough to be worth the time.

Comment on lines +55 to +70
create-issue-on-failure:
name: Create Issue on Failure
runs-on: ubuntu-latest
needs: esp-hal-nightly
if: failure()
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensures the repo is cloned before accessing the issue template

- name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
create-issue-on-failure:
name: Create Issue on Failure
runs-on: ubuntu-latest
needs: esp-hal-nightly
if: failure()
steps:
- name: Checkout repository
uses: actions/checkout@v4 # Ensures the repo is cloned before accessing the issue template
- name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true
- if: failure()
name: Create GitHub Issue
uses: JasonEtco/create-an-issue@v2
with:
filename: .github/ISSUE_TEMPLATE/nightly_ci.md
update_existing: true

I think this should work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog No changelog modification needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue creation when nightly runs fail
4 participants