Skip to content

Commit

Permalink
Merge pull request #1 from aleksandrlevochkin/1.2.0
Browse files Browse the repository at this point in the history
v1.3.0
  • Loading branch information
aleksandrlevochkin authored Apr 20, 2023
2 parents 1938238 + fe2b849 commit 3eeabd7
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- name: Get info
id: getinfo
uses: aleksandrlevochkin/print-info@v1.1.0
uses: aleksandrlevochkin/print-info@v1.3.0
with:
owner-name: "actions"
repository-name: "checkout"
Expand All @@ -23,9 +23,9 @@ jobs:
echo "Total number of issues is ${{ steps.getinfo.outputs.total-issues }}"
echo "Number of open issues is ${{ steps.getinfo.outputs.open-issues }}"
echo "Number of closed issues is ${{ steps.getinfo.outputs.closed-issues }}"
echo "Number of issues opened since ${{ steps.getinfo.inputs.from-date }} is ${{ steps.getinfo.outputs.issues-since-date }}"
echo "Number of issues opened since ${{ steps.getinfo.outputs.from-date-input }} is ${{ steps.getinfo.outputs.issues-since-date }}"
echo "Total number of pull requests is ${{ steps.getinfo.outputs.total-pulls }}"
echo "Number of open pull requests is ${{ steps.getinfo.outputs.open-pulls }}"
echo "Number of closed pull requests is ${{ steps.getinfo.outputs.closed-pulls }}"
echo "Number of pull requests opened since ${{ steps.getinfo.inputs.from-date }} is ${{ steps.getinfo.outputs.pulls-since-date }}"
echo "Number of pull requests opened since ${{ steps.getinfo.outputs.from-date-input }} is ${{ steps.getinfo.outputs.pulls-since-date }}"
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ Number of closed pull requests in the repository

Number of pull requests opened since given date

### `from-date-input`

The same `from-date` that is passed to the action's input. Needed to display the results more nicely

## Example usage

```yaml
uses: aleksandrlevochkin/print-info@v1.1.0
uses: aleksandrlevochkin/print-info@v1.3.0
with:
owner-name: "actions"
repository-name: "checkout"
Expand Down
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ outputs:
closed-pulls:
description: "Number of closed pull requests in the repository"
pulls-since-date:
description: "Number of pull requests opened since given date"

description: "Number of pull requests opened since given date"
from-date-input:
description: "The same 'from-date' that is passed to the action's input. Needed to display the results more nicely"
runs:
using: "node16"
main: "dist/index.js"
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11436,6 +11436,7 @@ const setOutputs = (octokitClient, input) => __awaiter(void 0, void 0, void 0, f
const pullsOpenedSinceGivenDate = pulls.filter(pull => new Date(pull.created_at) > fromDateISOForComparison);
console.log(`PRs opened since ${fromDate}: ${pullsOpenedSinceGivenDate.length}`);
core.setOutput("pulls-since-date", pullsOpenedSinceGivenDate.length);
core.setOutput("from-date-input", fromDate);
});
runAction();

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "print-info",
"version": "1.1.0",
"version": "1.3.0",
"description": "",
"main": "src/index.ts",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const setOutputs = async (octokitClient: InstanceType<typeof GitHub>, input: Use
const pullsOpenedSinceGivenDate = pulls.filter(pull => new Date(pull.created_at) > fromDateISOForComparison);
console.log(`PRs opened since ${fromDate}: ${pullsOpenedSinceGivenDate.length}`);
core.setOutput("pulls-since-date", pullsOpenedSinceGivenDate.length);

core.setOutput("from-date-input", fromDate);
}

runAction();

0 comments on commit 3eeabd7

Please sign in to comment.