Skip to content

Commit

Permalink
fix: move log event to the start
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnassri committed Jul 25, 2023
1 parent a822ebc commit b8e7244
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ if (inputs.dry === 'true') {
core.info('🟠 running in dry-run mode')
}

core.info(`ℹ️ running from "${inputs.event}"`)

// exit early: incompatible workflow
if (!allowed.includes(github.context.eventName)) {
core.warning(`⚠️ action ran on incompatible event "${github.context.eventName}", only "${allowed.join('", "')}" are allowed`)
Expand Down Expand Up @@ -79,8 +81,6 @@ const localFiles = await files(workspace, options)
// scan repos
const changedRepositories = await scan(octokit, { repositories, localFiles })

core.info(`ℹ️ running from "${inputs.event}"`)

// determine which method to run
const method = (['pull_request', 'pull_request_target'].includes(inputs.event)) ? pull_request : push

Expand Down
11 changes: 2 additions & 9 deletions src/lib/repos.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ import core from '@actions/core'
import github from '@actions/github'
import micromatch from 'micromatch'

const mediaType = {
previews: [
'baptiste'
]
}

export default async function (octokit, options) {
// construct this template repo full name
const full_name = `${github.context.repo.owner}/${github.context.repo.repo}`

// determine type
const { data: { is_template, owner: { type } } } = await octokit.request('GET /repos/{owner}/{repo}', {
...github.context.repo,
mediaType
...github.context.repo
})

// exit early
Expand All @@ -36,8 +30,7 @@ export default async function (octokit, options) {
username: github.context.repo.owner,
org: github.context.repo.owner,
per_page: 100,
affiliation: 'owner',
mediaType
affiliation: 'owner'
})

const repositories = all.filter(repo => repo.archived === false) // only include non-archived repos
Expand Down

0 comments on commit b8e7244

Please sign in to comment.