Skip to content

Commit

Permalink
feat(jiraLinked): remove the check
Browse files Browse the repository at this point in the history
  • Loading branch information
pmlanger committed Oct 23, 2024
1 parent e516707 commit ed08a05
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-release-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Test skipping checks
uses: ./
with:
skipChecks: 'jira-linked,secrets-scan'
skipChecks: 'secrets-scan'
githubToken: ${{ secrets.GITHUB_TOKEN }}
dockerUsername: ${{ secrets.GITLEAKS_DOCKER_USERNAME }}
dockerPassword: ${{ secrets.GITLEAKS_DOCKER_PASSWORD }}
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ easier time rolling out new checks to teams. Win-win!

## Included Checks

- `jira-linked`: never forget a Jira Issue key in your commits or PRs
again!
- `secrets-scan`: make sure you're never ever ever commiting a secret to
your repo. _Shhh, it's a secret_ :shushing_face:
- `pii-detection`: make sure you're not uploading files with Personal Identifiable
Expand Down Expand Up @@ -40,7 +38,7 @@ commas:
```yaml
---
with:
skipChecks: 'jira-linked,secret-scan'
skipChecks: 'secret-scan,required-typescript'
```
Refer to the [list of checks](#included-checks) for the proper names
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
description: 'Optional checks to enable'
githubToken:
required: true
description: 'The github token to get PR info when checking for Jira Issue key'
description: 'Required for checks that need access to Github'
runs:
using: 'node20'
main: 'dist/index.js'
2 changes: 0 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

207 changes: 0 additions & 207 deletions src/checks/jiraLinked.test.ts

This file was deleted.

96 changes: 0 additions & 96 deletions src/checks/jiraLinked.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/infrastructure/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { GitHub as ActionsGitHub } from '@actions/github/lib/utils'
export type Octokit = InstanceType<typeof ActionsGitHub>
export type PullsGetResponse =
Endpoints['GET /repos/{owner}/{repo}/pulls/{pull_number}']['response']['data']
export type PullRequestsAssociatedWithCommitResponse =
Endpoints['GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls']['response']['data']
export type PullRequestFiles =
Endpoints['GET /repos/{owner}/{repo}/pulls/{pull_number}/files']['response']['data']
export type Content =
Expand Down Expand Up @@ -36,19 +34,6 @@ export class GitHub {
return response.data
}

async getPullRequestsAssociatedWithCommit(): Promise<PullRequestsAssociatedWithCommitResponse> {
const response =
await this.octokit.rest.repos.listPullRequestsAssociatedWithCommit({
owner: this.context.repo.owner,
repo: this.context.repo.repo,
commit_sha: this.context.sha,
mediaType: {
previews: ['groot'],
},
})
return response.data
}

async getPullRequestFiles(pull_number: number): Promise<PullRequestFiles> {
const response = await this.octokit.rest.pulls.listFiles({
owner: this.context.repo.owner,
Expand Down
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as core from '@actions/core'

import Check from './checks/check'
import bashCheck from './checks/bash'
import jiraLinked from './checks/jiraLinked'
import piiDetection from './checks/piiDetection'
import requiredTypeScript from './checks/requiredTypeScript'
import {
Expand All @@ -22,7 +21,6 @@ const mandatoryChecks: Check[] = [
]

const additionalChecks: Check[] = [
jiraLinked,
requiredTypeScript,
bashCheck({
name: 'validate-openapi',
Expand Down

0 comments on commit ed08a05

Please sign in to comment.