Skip to content

Make sure linting standards and code conventions are in the README, in every developer's local machine, as well as automatically run on every PR #255

Make sure linting standards and code conventions are in the README, in every developer's local machine, as well as automatically run on every PR

Make sure linting standards and code conventions are in the README, in every developer's local machine, as well as automatically run on every PR #255

name: Add Text to New Blank Issue
on:
issues:
types:
- opened
jobs:
add_text:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Add text to new blank issue
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue = context.issue; // Gets issue details
const issueBody = context.payload.issue.body; // Gets issue body
if (!issueBody || issueBody.trim() === '') { // Checks if the issue body is empty
const fs = require('fs');
const filePath = '.github/workflows/issue_body.md'; // The location of your file
const fileContent = fs.readFileSync(filePath, 'utf8'); // Reads file content
github.rest.issues.update({
owner: issue.owner,
repo: issue.repo,
issue_number: issue.number,
body: fileContent // Uses the file content as the body
});
}