Skip to content

Commit

Permalink
Merge pull request #3 from thalleslmF/pr-3
Browse files Browse the repository at this point in the history
fix conflict
  • Loading branch information
thalleslmF authored Jul 28, 2021
2 parents 1f2fb7c + 11433fb commit 1b8aac2
Show file tree
Hide file tree
Showing 52 changed files with 6,447 additions and 20 deletions.
28 changes: 8 additions & 20 deletions licence.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const core = require('@actions/core')
const github = require('@actions/github')
const axios = require('axios');
const fs = require("fs");

function getExtensionCommentPattern(extension) {
Expand All @@ -35,26 +36,13 @@ function getExtensionCommentPattern(extension) {

const checkLicense = async (fileNames, copyrightContent) => {
const token = core.getInput('token')

const octokit = github.getOctokit(token)
const prNumber = github.context.payload.pull_request ? github.context.payload.pull_request.number : 1
console.log(prNumber)
console.log( github.context.payload)
const owner = github.context.payload.repository.owner
const repo = github.context.payload.repository.name
console.log(owner)
console.log( github.context.payload)
const responsePr = await octokit.rest.pulls.get({
owner: owner,
repo: repo,
pull_number: prNumber
})
console.log(responsePr.data.head.sha)
const responseCompare = await octokit.request('GET /repos/{owner}/{repo}/compare/{basehead}', {
owner: owner,
repo: repo,
basehead: `${responsePr.data.head.sha}...${responsePr.data.base.sha}`
})
const compare = github.context.payload.compare
console.log(compare)
const headers = {
authorization: `token ${token}`
}
const responseCompare = await axios.get(compare,{ headers: headers })
console.log(responseCompare)
const listFilesPr = responseCompare.data.files.map(
file => file.filename
)
Expand Down
685 changes: 685 additions & 0 deletions node_modules/axios/CHANGELOG.md

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions node_modules/axios/LICENSE

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

Loading

0 comments on commit 1b8aac2

Please sign in to comment.