Skip to content

Commit

Permalink
fixed pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
t0m3kz committed Feb 19, 2025
1 parent 83102de commit 989fd4e
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,26 @@ jobs:
run: |
echo "Running test deployment"
poetry run -P vyos sync -i ./inventory.yaml -v -m -t
- name: Read files content and create PR comment
uses: actions/github-script@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const files = fs.readdirSync('changes');
let content = '';
files.forEach(file => {
const fileContent = fs.readFileSync(`changes/${file}`, 'utf8');
content += `\n\n${fileContent}`;
});
const commentBody = `Hello! With this PR you'll apply these changes:\n\n${content}`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
})
- name: Read files content and create PR comment
uses: actions/github-script@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const files = fs.readdirSync('changes');
let content = '';
if (files.length === 0) {
content = 'No changes will be applied';
} else {
files.forEach(file => {
const fileContent = fs.readFileSync(`changes/${file}`, 'utf8');
content += `\n\n${fileContent}`;
});
}
const commentBody = `Hello! With this PR you'll apply these changes:\n\n${content}`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: commentBody
});

0 comments on commit 989fd4e

Please sign in to comment.