2020-09-24 13:11:57 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Script reserving a RSPEC identifier.
|
|
|
|
# It is used by the Github Action script "create_new_rspec.yml".
|
|
|
|
|
|
|
|
# Stop script in case of error.
|
|
|
|
set -e
|
|
|
|
|
2020-09-24 13:32:18 +02:00
|
|
|
RSPEC_ID_COUNTER_FILE=$1
|
|
|
|
|
2020-09-24 13:11:57 +02:00
|
|
|
# Increment the next_id counter.
|
2020-09-24 13:32:18 +02:00
|
|
|
next_id=`cat ${RSPEC_ID_COUNTER_FILE}`
|
2020-09-24 13:11:57 +02:00
|
|
|
new_next_id=`expr $next_id + 1`
|
2020-09-24 13:32:18 +02:00
|
|
|
echo $new_next_id > ${RSPEC_ID_COUNTER_FILE}
|
|
|
|
git add ${RSPEC_ID_COUNTER_FILE}
|
2020-09-24 13:35:00 +02:00
|
|
|
git commit -m "Increment RSPEC ID counter"
|
2020-09-24 13:11:57 +02:00
|
|
|
git push origin rspec-id-counter
|
|
|
|
|
|
|
|
# Set the Environment variable for the next Github Action.
|
2020-09-24 13:45:27 +02:00
|
|
|
echo "::set-env name=RSPEC_ID::${next_id}"
|
2020-09-24 17:07:59 +02:00
|
|
|
echo "::set-output name=rspec-id::${next_id}"
|