Skip to content

Commit 000bb83

Browse files
committed
[CI] Update the action that creates issues on e2e errors
1 parent 2eb1a8e commit 000bb83

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/end_to_end_tests.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
- name: Test application
6262
working-directory: ${{ github.job }}
6363
run: |
64+
rm -v .env.local
6465
php bin/console about
6566
symfony server:start -d --no-tls
6667
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
@@ -94,7 +95,7 @@ jobs:
9495
symfony server:stop
9596
9697
notify-on-failure:
97-
if: failure()
98+
if: ${{ always() && contains(needs.*.result, 'failure') }}
9899
name: Notify on Failure
99100
needs: [test-symfony-cli-installation, test-composer-create-project, test-git-clone-installation]
100101
runs-on: ubuntu-latest
@@ -105,25 +106,30 @@ jobs:
105106
steps:
106107
- name: Create Issue on Failure
107108
uses: actions/github-script@v7
109+
env:
110+
NEEDS_CONTEXT: ${{ toJSON(needs) }}
108111
with:
109112
script: |
110-
const title = `End to End Test Failed - ${new Date().toISOString().split('T')[0]}`;
111-
const body = `The daily end to end test workflow has failed.
113+
const needsContext = JSON.parse(process.env.NEEDS_CONTEXT);
114+
const failedJobs = Object.keys(needsContext)
115+
.filter(jobName => 'failure' === needsContext[jobName].result)
116+
.map(jobName => `- **${needsContext[jobName].outputs.name || jobName}**: Failed`);
112117
113-
This means users may be experiencing issues installing the Symfony Demo application.
118+
const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
119+
const title = `E2E Test Failure: ${new Date().toISOString().split('T')[0]}`;
120+
121+
const body = `
122+
The daily end-to-end test workflow has failed.
114123
115-
**Failed Jobs:**
116-
- Check the workflow run for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
124+
This means users may be experiencing issues installing the Symfony Demo application.
117125
118-
**Installation Methods Tested:**
119-
- Symfony CLI installation
120-
- Composer create-project
121-
- Git clone + composer install
126+
### Failed Jobs:
127+
${failedJobs.join('\n')}
122128
123129
Please investigate and fix the installation issues as soon as possible.
124130
`;
125131
126-
github.rest.issues.create({
132+
await github.rest.issues.create({
127133
owner: context.repo.owner,
128134
repo: context.repo.repo,
129135
title: title,

0 commit comments

Comments
 (0)