Fix ci error comments (#7416)

# Objective

- Fix a few errors on the workflow for leaving comments after ci failures
This commit is contained in:
François 2023-01-29 23:05:33 +00:00
parent bfd1d4b0a7
commit 1e591bf7a5
2 changed files with 7 additions and 7 deletions

View File

@ -60,7 +60,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'Example ' + last_example_run + ' failed to run, please try running it locally and check the result.'
body: 'Example `' + last_example_run + '` failed to run, please try running it locally and check the result.'
});
missing-examples:
@ -104,20 +104,20 @@ jobs:
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./NR'));
if (existsSync('./missing-metadata')) {
if (fs.existsSync('./missing-metadata')) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'You added a new example but didn't add metadata for it. Please update the root Cargo.toml file.'
body: 'You added a new example but didn\'t add metadata for it. Please update the root Cargo.toml file.'
});
}
if (existsSync('./missing-update')) {
if (fs.existsSync('./missing-update')) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: 'You added a new example but didn't update the readme. Please run `cargo run -p build-example-pages -- update` to update it, and commit the file change.'
body: 'You added a new example but didn\'t update the readme. Please run `cargo run -p build-example-pages -- update` to update it, and commit the file change.'
});
}

View File

@ -191,7 +191,7 @@ jobs:
run: |
for example in .github/example-run/*.ron; do
example_name=`basename $example .ron`
echo $example > last_example_run
echo -n $example_name > last_example_run
echo "running $example_name - "`date`
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
sleep 10
@ -207,7 +207,7 @@ jobs:
run: |
mkdir -p ./example-run
echo ${{ github.event.number }} > ./example-run/NR
mv last_example_run > ./example-run/
mv last_example_run ./example-run/
- uses: actions/upload-artifact@v2
if: ${{ failure() && github.event_name == 'pull_request' }}
with: