Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #71: Fixing the markdown check and repo standard workflow #72

2 changes: 1 addition & 1 deletion .github/workflows/workflow-markdown-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Validating links
uses: gaurav-nelson/github-action-markdown-link-check@v1
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/workflow-repo-standards-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,24 @@ jobs:
with:
script: |
const { owner, repo } = context.repo;
let refBranchNumber;

if (context.eventName === 'pull_request') {
refBranchNumber = context.payload.pull_request.head.ref;
} else {
refBranchNumber = process.env['GITHUB_REF'].replace('refs/heads/', '');
}

try {
await github.rest.repos.getContent({
owner,
repo,
path: 'README.md'
path: `README.md`,
ref: refBranchNumber
});
} catch (error) {
if (error.status === 404) {
core.setFailed("The repository does not have a README.md file, please add one.");
core.setFailed(`The ${refBranchNumber} branch does not have a README.md file, please add one.`);
} else {
core.setFailed(`An error occurred while checking for README: ${error.message}`);
}
Expand All @@ -100,21 +109,31 @@ jobs:
with:
script: |
const { owner, repo } = context.repo;
let refBranchNumber;

if (context.eventName === 'pull_request') {
refBranchNumber = context.payload.pull_request.head.ref;
} else {
refBranchNumber = process.env['GITHUB_REF'].replace('refs/heads/', '');
}

try {
await github.rest.repos.getContent({
owner,
repo,
path: 'TESTING.md'
path: `TESTING.md`,
ref: refBranchNumber
});
} catch (error) {
if (error.status === 404) {
core.setFailed("The repository does not have a TESTING.md file, please add one.");
core.setFailed(`The ${refBranchNumber} branch does not have a TESTING.md file, please add one.`);
} else {
core.setFailed(`An error occurred while checking for TESTING.md: ${error.message}`);
}
}
if: always() # Run step even if previous steps fail.


- name: Check if all files end in newline
uses: fernandrone/linelint@master
id: linelint
Expand Down