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

Add inactive repos as action output #29

Merged
merged 13 commits into from
Jun 6, 2023
Merged

Add inactive repos as action output #29

merged 13 commits into from
Jun 6, 2023

Conversation

akbast
Copy link
Contributor

@akbast akbast commented Jun 6, 2023

As defined in #28 The action outputs inactive repos in json format for further actions.

Example usage:

    - name: Run stale_repos tool
      id: stale-repos
      uses: akbast/stale-repos@main
      env:
        GH_TOKEN: ${{ secrets.GH_TOKEN }}
        ORGANIZATION: akbas-orga
        INACTIVE_DAYS: 1

    - name: Print output of stale_repos tool
      run: echo "${{ steps.stale-repos.outputs.inactiveRepos }}"
    - uses: actions/github-script@v6
      with:
        script: |
          const repos = ${{ steps.stale-repos.outputs.inactiveRepos }}
          for (const repo of repos) {
            console.log(repo);
            const issue = await github.rest.issues.create({
              owner: 'akbast',
              repo: 'stale-repos',
              title: 'Stale repo' + repo.url,
              body: 'This repo is stale. Please contact the owner to make it active again.',
            });
            console.log(issue);
          }
        github-token: ${{ secrets.GH_TOKEN }}

Example Issue: akbast#10

@akbast akbast requested a review from zkoppert as a code owner June 6, 2023 19:25
@zkoppert zkoppert added the enhancement New feature or request label Jun 6, 2023
Copy link
Member

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! I've updated the README with your example of usage. Appreciate the contribution!

@zkoppert zkoppert merged commit 8a4e34d into github:main Jun 6, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants