From ded05960f3d8a3d6aef0f909f026ac55001e39e2 Mon Sep 17 00:00:00 2001
From: Peter Evans <peter-evans@users.noreply.github.com>
Date: Sun, 10 May 2020 18:06:32 +0900
Subject: [PATCH] Deprecate pr_number output

---
 README.md                                | 4 ++--
 action.yml                               | 2 +-
 src/cpr/create_or_update_pull_request.py | 2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index ed206b3..a04db42 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ Note that in order to read the step output the action step must have an id.
       - name: Check outputs
         run: |
           echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
-          echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"
+          echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
 ```
 
 ### Checkout
@@ -188,7 +188,7 @@ jobs:
       - name: Check outputs
         run: |
           echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}"
-          echo "Pull Request Number - ${{ steps.cpr.outputs.pr_number }}"
+          echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
 ```
 
 This reference configuration will create pull requests that look like this:
diff --git a/action.yml b/action.yml
index f4483f6..2519cf1 100644
--- a/action.yml
+++ b/action.yml
@@ -40,7 +40,7 @@ inputs:
   branch-suffix:
     description: 'The branch suffix type.'
 outputs:
-  pr_number:
+  pull-request-number:
     description: 'The pull request number'
 runs:
   using: 'node12'
diff --git a/src/cpr/create_or_update_pull_request.py b/src/cpr/create_or_update_pull_request.py
index de953a0..a34b090 100644
--- a/src/cpr/create_or_update_pull_request.py
+++ b/src/cpr/create_or_update_pull_request.py
@@ -113,6 +113,8 @@ def create_or_update_pull_request(
 
     # Set the output variables
     os.system(f"echo ::set-env name=PULL_REQUEST_NUMBER::{pull_request.number}")
+    os.system(f"echo ::set-output name=pull-request-number::{pull_request.number}")
+    # 'pr_number' is deprecated
     os.system(f"echo ::set-output name=pr_number::{pull_request.number}")
 
     # Set labels, assignees and milestone