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:11:57 +02:00
|
|
|
git commit "Increment RSPEC ID counter"
|
|
|
|
git push origin rspec-id-counter
|
|
|
|
|
|
|
|
# Set the Environment variable for the next Github Action.
|
|
|
|
echo "::set-env name RSPEC_ID=${next_id}"
|