forked from nyanloutre/nixos-config
pr-autobot: migration 18.09 -> 19.03
This commit is contained in:
parent
ad7cf64959
commit
414be4c06a
@ -27,7 +27,7 @@ in
|
|||||||
ignoreCollisions = true;
|
ignoreCollisions = true;
|
||||||
};
|
};
|
||||||
in "${pkgs.writeShellScriptBin "run.sh" ''
|
in "${pkgs.writeShellScriptBin "run.sh" ''
|
||||||
${env}/bin/python ${pkgs.writeScript "pr-autobot.py" "${readFile ./pr-autobot.py}"} --private-key /var/lib/auto-pr-bot/private-key.pem --app-id 19565 --installation-id 407088 --repo nyanloutre/nixpkgs --cache-dir /var/cache/auto-pr-bot
|
${env}/bin/python ${pkgs.writeScript "pr-autobot.py" "${readFile ./pr-autobot.py}"} --private-key /var/lib/auto-pr-bot/private-key.pem --app-id 19565 --installation-id 407088 --repo nyanloutre/nixpkgs --cache-dir /var/cache/auto-pr-bot --version 19.03
|
||||||
''}/bin/run.sh";
|
''}/bin/run.sh";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -11,9 +11,10 @@ parser.add_argument('--app-id')
|
|||||||
parser.add_argument('--installation-id')
|
parser.add_argument('--installation-id')
|
||||||
parser.add_argument('--repo')
|
parser.add_argument('--repo')
|
||||||
parser.add_argument('--cache-dir')
|
parser.add_argument('--cache-dir')
|
||||||
|
parser.add_argument('--version')
|
||||||
args = vars(parser.parse_args())
|
args = vars(parser.parse_args())
|
||||||
|
|
||||||
channel_req = urllib.request.Request(url='https://nixos.org/channels/nixos-18.09/git-revision')
|
channel_req = urllib.request.Request(url='https://nixos.org/channels/nixos-' + args["version"] + '/git-revision')
|
||||||
latest_commit = urllib.request.urlopen(channel_req).read().decode('utf-8')
|
latest_commit = urllib.request.urlopen(channel_req).read().decode('utf-8')
|
||||||
try:
|
try:
|
||||||
previous_commit = open(args['cache_dir'] + '/git-revision', 'r').read()
|
previous_commit = open(args['cache_dir'] + '/git-revision', 'r').read()
|
||||||
@ -57,7 +58,7 @@ if latest_commit != previous_commit:
|
|||||||
- [ ] Fusionner la branche
|
- [ ] Fusionner la branche
|
||||||
""")
|
""")
|
||||||
|
|
||||||
pr = repo.create_pull(title=branch, body=pr_message, base='nixos-18.09', head=branch)
|
pr = repo.create_pull(title=branch, body=pr_message, base='nixos-' + args["version"], head=branch)
|
||||||
|
|
||||||
print("Pull request numéro " + str(pr.number) + " créée")
|
print("Pull request numéro " + str(pr.number) + " créée")
|
||||||
print("URL : " + pr.html_url)
|
print("URL : " + pr.html_url)
|
||||||
|
Loading…
Reference in New Issue
Block a user