Indirect Templates - Best Practice - Replace Step in Workflow #1891
-
Short VersionWe want to replace a Step in an existing AL-Go Workflow but we are not quite sure how to do it to not mess around with future AL-Go Updates ExampleWe dont want to use the Release Notes prepared by AL-Go for our Releases. Instead we want to use the latest existing draft Body from the Releases. The Default Worfklow for Releases has a step to create Release Notes: - name: Prepare release notes
id: createreleasenotes
uses: microsoft/AL-Go-Actions/CreateReleaseNotes@v7.2
with:
shell: powershell
buildVersion: ${{ github.event.inputs.buildVersion }}
tag_name: ${{ github.event.inputs.tag }}
target_commitish: ${{ steps.determineArtifactsForRelease.outputs.commitish }} We want to Replace this Step by a Custom one to either use the current draft or generate Release notes by a thirs Party app such as Release Drafter - name: Prepare release notes (use latest draft body)
id: createreleasenotes
uses: actions/github-script@v7
with:
github-token: ${{ steps.ReadSecrets.outputs.TokenForPush }}
script: |
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100
});
const drafts = releases.filter(r => r.draft);
if (!drafts.length) {
core.warning('Kein Draft-Release gefunden – gebe leeren Body zurück.');
core.setOutput('releaseNotes', '');
return;
}
drafts.sort((a,b) => new Date(b.updated_at) - new Date(a.updated_at));
const latest = drafts[0];
const body = latest.body || '';
core.setOutput('releaseNotes', body); QuestionReplacing the Step Could you please give us some guidance on how to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Editing the "Microsoft owned" jobs in the workflows is not something we support. You can add your own custom jobs and custom workflows but we do not support adding custom steps/removing steps from existing jobs. In this case you could either:
|
Beta Was this translation helpful? Give feedback.
Editing the "Microsoft owned" jobs in the workflows is not something we support. You can add your own custom jobs and custom workflows but we do not support adding custom steps/removing steps from existing jobs.
In this case you could either: